Click here to Skip to main content
15,916,180 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Combobox in datagrid Pin
Ritesh123416-Jan-05 21:59
Ritesh123416-Jan-05 21:59 
Generallame_enc.dll Pin
victor_ba8516-Jan-05 19:41
victor_ba8516-Jan-05 19:41 
GeneralRe: lame_enc.dll Pin
Dennis C. Dietrich16-Jan-05 22:09
Dennis C. Dietrich16-Jan-05 22:09 
GeneralArray of controls Pin
Yulianto.16-Jan-05 16:18
Yulianto.16-Jan-05 16:18 
GeneralRe: Array of controls Pin
Rizwan Bashir16-Jan-05 22:17
Rizwan Bashir16-Jan-05 22:17 
GeneralRe: Array of controls Pin
Yulianto.16-Jan-05 23:27
Yulianto.16-Jan-05 23:27 
GeneralRe: Array of controls Pin
Dennis C. Dietrich17-Jan-05 7:06
Dennis C. Dietrich17-Jan-05 7:06 
GeneralRe: Array of controls Pin
Dennis C. Dietrich16-Jan-05 22:39
Dennis C. Dietrich16-Jan-05 22:39 
goodmast3r wrote:
How to create array of controls like labels or combobox at run time, so that when the user input an integer, it will create the controls dinamically. Can this be done?

In addition to what Rizwan already wrote you might want to call Control.SuspendLayout()[^] and Control.ResumeLayout()[^] depending on how complex your operations are. I used two loops just to point out the two steps of the initial creation of the objects and a later manipulation.
Dim newLeft As Integer = 0
Dim newTop As Integer = 0
Dim counter As Integer = 0

Dim newButton As Button
Dim myButtons(4) As Button

Me.SuspendLayout()
For counter = 0 To myButtons.Length - 1
    newButton = New Button()
    newButton.Left = newLeft
    newButton.Top = newTop
    myButtons(counter) = newButton
    newLeft += 32
    newTop += 32
Next counter
Me.Controls.AddRange(myButtons)
Me.ResumeLayout()

For counter = 0 To myButtons.Length - 1
    myButtons(counter).Text = "Button #" & (counter + 1).ToString("d")
Next counter

Best regards
Dennis
GeneralArray of controls Pin
Yulianto.16-Jan-05 16:06
Yulianto.16-Jan-05 16:06 
GeneralRe: Array of controls Pin
-Dr_X-20-Jan-05 14:03
-Dr_X-20-Jan-05 14:03 
GeneralProblem With Splash Screen Pin
kellydanielc16-Jan-05 13:56
kellydanielc16-Jan-05 13:56 
GeneralRe: Problem With Splash Screen Pin
Gavin Jeffrey17-Jan-05 0:43
Gavin Jeffrey17-Jan-05 0:43 
GeneralRe: Problem With Splash Screen Pin
kellydanielc17-Jan-05 0:54
kellydanielc17-Jan-05 0:54 
GeneralRe: Problem With Splash Screen Pin
Gavin Jeffrey17-Jan-05 1:10
Gavin Jeffrey17-Jan-05 1:10 
GeneralRe: Problem With Splash Screen Pin
Jodd19-Jan-05 14:55
Jodd19-Jan-05 14:55 
Generalquestion2 Pin
Makniteasy16-Jan-05 10:04
Makniteasy16-Jan-05 10:04 
GeneralRe: question2 Pin
Rizwan Bashir17-Jan-05 0:43
Rizwan Bashir17-Jan-05 0:43 
Generalquestion Pin
Makniteasy16-Jan-05 9:54
Makniteasy16-Jan-05 9:54 
GeneralContorl modification From Multiple location Pin
Member 152636216-Jan-05 8:19
Member 152636216-Jan-05 8:19 
GeneralAntiVirus w/ VB Pin
TheGOG16-Jan-05 7:16
TheGOG16-Jan-05 7:16 
GeneralRe: AntiVirus w/ VB Pin
Dave Kreskowiak18-Jan-05 3:57
mveDave Kreskowiak18-Jan-05 3:57 
Generalfill datagrid Pin
anom2m16-Jan-05 2:32
anom2m16-Jan-05 2:32 
GeneralRe: fill datagrid Pin
Makniteasy16-Jan-05 15:36
Makniteasy16-Jan-05 15:36 
GeneralSort by date files in dialog box Pin
aprx16-Jan-05 0:26
aprx16-Jan-05 0:26 
QuestionThe source code of a 3D Sokoban Game in Visual Basic? Pin
Ciara Ibrahim15-Jan-05 18:53
sussCiara Ibrahim15-Jan-05 18:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.