Advertisement

08.02.2004 at 08:25AM PDT, ID: 21079304
[x]
Attachment Details

vb.net dynamic control creation

Asked by illu666 in Windows MobileProgramming

Tags: dynamic, control, create

I'm developing an application in VB.NET on compact framework.

I'm creating a form with a variable number of controls, so i must create then at runtime. In vb6 i can create an array of controls and increment it. But not in vb.net.

so i need to create controls (textbox and combobox) giving then a name but how?
i can't declare something like  << dim "textbox_12" as new textbox >> obviously

i tried

        For i = 0 To 10
            Dim newcontrol As New TextBox
            newcontrol.Top = 20 * i
            Me.Controls.Add(newcontrol)
        Next i

and it adds the controls to the form how can i manage then? How do i know what there is in textbox_12?
i could cycle in me.controls, but i can't identify the right control because "name" property is not supported in compact framework...
Start Free Trial
[+][-]08.02.2004 at 12:49PM PDT, ID: 11697380

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2004 at 11:15PM PDT, ID: 11733159

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.05.2004 at 11:41PM PDT, ID: 11733236

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Windows MobileProgramming
Tags: dynamic, control, create
Sign Up Now!
Solution Provided By: prakash_prk
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32