Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controls limitions in a form

Status
Not open for further replies.

ahhuang

Programmer
Apr 1, 2002
61
SG
I have reached the maximum limitations for number of controls to be in a form.
I think the maximum is 255.
Is there any way i can increase the maximum limitations?
If there is, how can i do it?
Thanx

Regards
Ahhuang
 
Have you tried using control arrays? A control array is a group of controls counted as 1 (I believe) as far as maximum number of controls goes. Their events work a little differently than single controls but if you change all of your labels to be members of a single control array, you might not need to do any recoding.
 
At design-time, change a label's Index property to a number that has not already been used in the intended Conmtrol Array then change the name of the label to the name of the control array. The Control Array name need not already exist. Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Ahhuang ,

a partial example of using Control Arrays
use the new "INDEX as Integer" that will appear in your Subs
------------------------------------------------------
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)

Select Case KeyCode
Case vbKeyPageUp, vbKeyUp, vbKeyEscape
Select Case Index
Case 0
Combo1(0).SetFocus
Case 1
Text1(0).SetFocus
Case 2
Text1(1).SetFocus
Case 3
Text1(2).SetFocus
Case 4
Text1(3).SetFocus
Case 5
Text1(4).SetFocus
Case 6
Text1(5).SetFocus
Case 7
Combo1(1).SetFocus
Case 8
Combo1(2).SetFocus
Case 9
Text1(8).SetFocus
Case 10
Text1(9).SetFocus
Case 11
Combo1(3).SetFocus
Case 12
Text1(11).SetFocus
Case 13
Text1(12).SetFocus
Case 14
Text1(13).SetFocus
Case 15
Text1(14).SetFocus
Case 16
Text1(15).SetFocus
Case 17
Text1(16).SetFocus
Case 18
Text1(17).SetFocus
Case 19
Text1(18).SetFocus
Case 20
Text1(19).SetFocus
Case 21
Text1(20).SetFocus
Case 22
Text1(21).SetFocus
Case 23
Text1(22).SetFocus
Case 24
Text1(23).SetFocus
Case 25
Text1(24).SetFocus
Case 26
Text1(25).SetFocus
Case 27
Text1(26).SetFocus
Case 28
Text1(27).SetFocus
End Select

Case vbKeyPageDown, vbKeyDown, vbKeyReturn
Select Case Index
Case 0
Text1(1).SetFocus
Case 1
Text1(2).SetFocus
Case 2
Text1(3).SetFocus
Case 3
Text1(4).SetFocus
Case 4
Text1(5).SetFocus
Case 5
Text1(6).SetFocus
Case 6
Combo1(1).SetFocus
Case 7
Combo1(2).SetFocus
Case 8
Text1(9).SetFocus
Case 9
Text1(10).SetFocus
Case 10
Combo1(3).SetFocus
Case 11
Text1(12).SetFocus
Case 12
Text1(13).SetFocus
Case 13
Text1(14).SetFocus
Case 14
Text1(15).SetFocus
Case 15
Text1(16).SetFocus
Case 16
Text1(17).SetFocus
Case 17
Text1(18).SetFocus
Case 18
Text1(19).SetFocus
Case 19
Text1(20).SetFocus
Case 20
Text1(21).SetFocus
Case 21
Text1(22).SetFocus
Case 22
Text1(23).SetFocus
Case 23
Text1(24).SetFocus
Case 24
Text1(25).SetFocus
Case 25
Text1(26).SetFocus
Case 26
Text1(27).SetFocus
Case 27
Text1(28).SetFocus
Case 28
Combo1(0).SetFocus
End Select

End Select


End Sub

---------------------------

MaxRace Software - Larry Meaux
ET_Analyst for DragRacers
Support Israel - Genesis 12:3
 
Ahhuang ,

1 more thing ..you will find out "Copying/Pasteing"

groups of Control Arrays ; such as , TextBoxes ,

that VB6.0 will "REVERSE" the new pasted Control Array Index

"ORDER" .........also , the 3D effects of TextBox bottom

shadow color will change slightly MaxRace Software - Larry Meaux
ET_Analyst for DragRacers
Support Israel - Genesis 12:3
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top