Solved

Adding control on the fly

Posted on 1998-09-23
4
172 Views
Last Modified: 2010-04-30
I have to text box in a form i want to add many more text box on the same form but i have to had those text box when the programm is running so on the fly and as much as i need, this number may vary from each time i run the program.

Anybody has some code to explain that::
0
Comment
Question by:dabellei
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
shogi earned 70 total points
ID: 1436273
dim YouTexteBox() as TextXXX
dim nYouTexteBox as integer

nYouTexteBox = nYouTextBox + 1
load YouTexteBox(n)

' move at the position your textebox
YouTextBox(n).Visible = True

if you need more information ask me,
Have a good day
Shogi


0
 
LVL 2

Author Comment

by:dabellei
ID: 1436274
i've try your code it's not working as is r maybe i don't do it right

i've replace the n with nYouTextBox.

I want to create a new control label on mw form from nothing there's nothing on the form at the beginning.  Send me a working code that you test before..

Thank's
0
 
LVL 2

Expert Comment

by:shogi
ID: 1436275
Create a new project.

Put a commandButton :

Name = cmdMyListOfButton
Index = 0
Visible = False

===============================
Option Explicit
Dim nButton As Integer

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
   
    If nButton <> 0 Then
      Load cmdMyListOfButton(nButton)
   End If
 
   cmdMyListOfButton(nButton).Top = Y
   cmdMyListOfButton(nButton).Left = X
   cmdMyListOfButton(nButton).Caption = "Button" + CStr(nButton)
   cmdMyListOfButton(nButton).Visible = True
   nButton = nButton + 1
End Sub
==============

I hope that it'll help you.
Shogi
0
 
LVL 2

Expert Comment

by:shogi
ID: 1436276
Sorry I make the example with buttonCommand, but with TextBox it's the same.

Shogi.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question