Page 1 of 1

But Why..... Any one know

Posted: Sat Aug 11, 2012 3:44 am
by muttley1968
Hi Added this code to my project a while ago and it works fine but for some reason it has stoped working and it is for one of the most important parts of the project anyone know why its not working I don't get any errors just does not add the controls
Code: Select all
        Dim btnTop As Integer = 0
        For i As Integer = 0 To Faves.Items.Count - 1
            Dim favebtn As ToolStripButton
            favebtn.Text = Faves.Items(i).ToString()
            favebtn.ForeColor = Color.White
            ToolStrip1.Items.Add(favebtn)
            AddHandler favebtn.Click, AddressOf btnclicked
            int = int + 1
            btnTop += 30
        Next
is suppose to add all the itms of a listbox to a toolstrip menu it works one by one adding them with the button but :P not all the items please someone help me :P

Re: But Why..... Any one know

Posted: Sat Aug 11, 2012 7:42 am
by Filip
Hi try to do
Code: Select all
Dim favebutton As New ToolStripButton

Re: But Why..... Any one know

Posted: Sat Aug 11, 2012 5:15 pm
by muttley1968
#visioncrO Thanks soo mutch haha I did not think of that retard moment for me there :p