Place controls during run-time 
Author Message
 Place controls during run-time

How can I place an control on a form (like a textbox), without placing this
control on the form at design-time?

Thanks

--
Verwijder Spam van m'n Email adres



Tue, 13 Mar 2001 03:00:00 GMT  
 Place controls during run-time
Upgrade to VB6.  <g>
--
[This space intentionally left blank.]
Quote:

>How can I place an control on a form (like a textbox), without placing this
>control on the form at design-time?

>Thanks

>--
>Verwijder Spam van m'n Email adres



Tue, 13 Mar 2001 03:00:00 GMT  
 Place controls during run-time
On Fri, 25 Sep 1998 12:54:38 -0700, "Karl E. Peterson"

Quote:

>Upgrade to VB6.  <g>
>--
>[This space intentionally left blank.]

In lieu of upgrading, you might try this:

    Dim x%
    x = cmdArray.UBound
    x = x + 1
    Load cmdArray(x)
    cmdArray(x).Left = cmdArray(x - 1).Left + 1500
    cmdArray(x).Visible = True

Of course, this only helps part of your problem. I don't know of a way
to start with no control on the form at all. This method has a control
which may or may not be visible. The index property is set to 0 to
make a control array, and you dynamically increment the array count,
position, and display the control.

Just my 2, though.



Tue, 13 Mar 2001 03:00:00 GMT  
 Place controls during run-time
But if you don't want to do that, there is some way of achieving it in VB4 and VB5 (maybe alo in VB3, but I can't
remember; too long ago).
Wiht the Load statement you can add controls to controlarrays. The controlarray (of course) has to exist.
So: create a textbox on the form with name something like TextBox(0).
In the code you can create other TextBoxes with: Load TextBox(1), Load TextBox(2), etc.


Quote:
> Upgrade to VB6.  <g>
> --
> [This space intentionally left blank.]


> >How can I place an control on a form (like a textbox), without placing this
> >control on the form at design-time?

> >Thanks

> >--
> >Verwijder Spam van m'n Email adres



Tue, 13 Mar 2001 03:00:00 GMT  
 Place controls during run-time
this is from vb 6.0 but may work for you

Dim WithEvents ctlTab As VB.VBControlExtender
Dim WithEvents ctlCommand As VB.CommandButton

Set ctlCommand = Controls.Add("VB.CommandButton", "ctlCommand1")

Set ctlTab = Controls.Add("TabDlg.SSTab.1", "ctlTab1")

Quote:

>How can I place an control on a form (like a textbox), without placing this
>control on the form at design-time?

>Thanks

>--
>Verwijder Spam van m'n Email adres



Tue, 20 Mar 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Place controls during run-time

2. Place controls during run-time

3. Place controls during run-time

4. Place controls during run-time

5. Place contols on controls during run-time

6. Place contols on controls during run-time

7. Place contols on controls during run-time

8. Place contols on controls during run-time

9. Place contols on controls during run-time

10. trouble placing label control onto form during runtime

11. Controlling Controls During Run-Time

12. Loading Image Control During Run Time

 

 
Powered by phpBB® Forum Software