Cor, you're talking about the TabIndex, right? Robin S. ------------------------------ [quoted text, click to view] "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message news:e$RMQN0SHHA.1000@TK2MSFTNGP05.phx.gbl... > Lou, > > Of course is there an index property. > The first in an array is 0. > > So the previous control is when it is not zero this index -1 > > Cor > > >
I have a menu item that creates a new command button. Each time I create a new command button I need to position it to the left of the last created button. In VB6 I could create a control array, look at the UBound of the array (Last control Created) and find the position of the last created control in order to place any new controls next to it. Creating controls in DotNet is different. I can create the controls dynamically but have no way of getting the co-ordinates of the previously created control since there is no index property. -Lou
Lou, Of course is there an index property. The first in an array is 0. So the previous control is when it is not zero this index -1 Cor
[quoted text, click to view] > Cor, you're talking about the TabIndex, right?
no . dim mycontrolarray() as control = {Button1, TextBox2, TextBox4, Button2} The indexes are in that case 0, 1,2,3 Cor
There is no index property of a button I thought you could not have an array of controls in DotNet. [quoted text, click to view] "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message news:O6fnIf0SHHA.3316@TK2MSFTNGP02.phx.gbl... > >> Cor, you're talking about the TabIndex, right? > > no . > > dim mycontrolarray() as control = {Button1, TextBox2, TextBox4, Button2} > > The indexes are in that case 0, 1,2,3 > > Cor > > >
[quoted text, click to view] On Feb 8, 7:42 am, "Lou" <lou.gar...@comcast.net> wrote: > There is no index property of a button > I thought you could not have an array of controls in DotNet. > > "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl> wrote in messagenews:O6fnIf0SHHA.3316@TK2MSFTNGP02.phx.gbl... > > > > >> Cor, you're talking about the TabIndex, right? > > > no . > > > dim mycontrolarray() as control = {Button1, TextBox2, TextBox4, Button2} > > > The indexes are in that case 0, 1,2,3 > > > Cor
He's talking about the index of an array that contains the control, not the old VB6 index property. Thanks, Seth Rowe
Yeah, that's what I suspected, but it wasn't clear. The OP is thinking about control arrays as they existed in VB6. Robin S. ------------------------------------- [quoted text, click to view] "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message news:O6fnIf0SHHA.3316@TK2MSFTNGP02.phx.gbl... > >> Cor, you're talking about the TabIndex, right? > > no . > > dim mycontrolarray() as control = {Button1, TextBox2, TextBox4, Button2} > > The indexes are in that case 0, 1,2,3 > > Cor > > >
You can put them in an array yourself in the code behind the form, as Cor has done in his example. Robin S. ------------------------------------ [quoted text, click to view] "Lou" <lou.garvin@comcast.net> wrote in message news:upjGf63SHHA.4252@TK2MSFTNGP05.phx.gbl... > There is no index property of a button > I thought you could not have an array of controls in DotNet. > > > "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message > news:O6fnIf0SHHA.3316@TK2MSFTNGP02.phx.gbl... >> >>> Cor, you're talking about the TabIndex, right? >> >> no . >> >> dim mycontrolarray() as control = {Button1, TextBox2, TextBox4, Button2} >> >> The indexes are in that case 0, 1,2,3 >> >> Cor >> >> >> > >
Don't see what you're looking for? Try a search.
|