Solved

Adding control on the fly

Posted on 1998-09-23
4
178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…

733 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