.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 30th, 2012, 03:44 PM
IMaVBNoob's Avatar
IMaVBNoob IMaVBNoob is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 122 IMaVBNoob User rank is Private First Class (20 - 50 Reputation Level)IMaVBNoob User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 13 h 57 m 38 sec
Reputation Power: 8
Send a message via MSN to IMaVBNoob
Creating control and handler at runtime Problem!!!

So i created a control at runtime and added the event handler
my isusse arises when the runtime combobox selected item is changed it looks for the selected item in combobox6 and not .Name = "actioncombo-" & num

how can i make it so the resulting selected item it from .Name = "actioncombo-" & num


Code:
With action2combo1
            .Name = "actioncombo-" & num
            .Left = 60
            .Top = InnerStepContainer.Height - 45
            .Width = 165
            .Items.Add("Navigate to a url")
            .Items.Add("Gather page details")
            .Items.Add("Fill text field")
            .Items.Add("Check a checkbox")
            .Items.Add("Click radio button")
            .Items.Add("Fill combo box")
            .Items.Add("Click a image")
            .Items.Add("Select list box item")
            .Items.Add("Click a button")
            .Items.Add("Repeat all steps every")
            .Items.Add("End Navigation")
            .Text = "Choose One"
            .BringToFront()
            .Height = 24
            This is what i need but also wont work--->> AddHandler "actioncombo-" & num & .SelectedIndexChanged, AddressOf ComboBox6_SelectedIndexChanged

should be ---->> AddHandler actioncombo-1.SelectedIndexChanged, AddressOf ComboBox6_SelectedIndexChanged

        End With


Code:
Private Sub ComboBox6_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox6.SelectedIndexChanged
If Combobox6.SelectedItem.ToString = "Navigate to a url" Then
      
and here is where my prblem lies---->>  If [selectedcomboboxname].SelectedItem.ToString = "Navigate to a url" Then
how can i return the name of the selected combobox?

            ComboBox3.Visible = False
            ComboBox2.Visible = False
            TextBox1.Visible = False
            TextBox3.Visible = False
            Label2.Visible = False
            Label8.Visible = False
            Label9.Visible = False
            Label10.Visible = False
            navBox.Visible = True
        Else
            If ComboBox6.SelectedItem.ToString = "Fill text field" Or ComboBox6.SelectedItem.ToString = "Fill combo box" Then
                ComboBox3.Visible = True
                ComboBox2.Visible = True
                TextBox1.Visible = True
                TextBox3.Visible = True
                Label2.Visible = True
                Label8.Visible = True
                Label9.Visible = True
                Label10.Visible = True
                navBox.Visible = False
            Else
                ComboBox3.Visible = True
                ComboBox2.Visible = True
                TextBox1.Visible = True
                Label2.Visible = True
                Label8.Visible = True
                Label9.Visible = True
                Label10.Visible = False
                TextBox3.Visible = False
                navBox.Visible = False
            End If
        End If
    End Sub

Reply With Quote
  #2  
Old August 9th, 2012, 03:48 PM
IMaVBNoob's Avatar
IMaVBNoob IMaVBNoob is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 122 IMaVBNoob User rank is Private First Class (20 - 50 Reputation Level)IMaVBNoob User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 13 h 57 m 38 sec
Reputation Power: 8
Send a message via MSN to IMaVBNoob
fix own my problem

i was on the right track just had to add some arrays for the controls at runtime tweeked it a bit and all is golden

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Creating control and handler at runtime Problem!!!

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap