Solved

Can this be done, and how...?

Posted on 1998-06-10
3
143 Views
Last Modified: 2010-05-03
I am using VB 5 Pro, and want to know if and how I can do the following...it seems like I can, but I just cannot string the command/logic together to get it working properly.

Picture a button on a form.  When you click on the button, you get a text box appearing on the screen.  Click again and another appears, and so on and so on.  I want to 'dynamically create text boxes'....can it (or something very similar, maybe RichText) be done?  And if so, could you please give me a run down of the major commands involved (set command?  dim x as textbox?).

Thanks for you time
oreg
0
Comment
Question by:oreg
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
marti earned 210 total points
ID: 1463048
This could be done with LOAD command.
0
 
LVL 2

Expert Comment

by:marti
ID: 1463049
Put a RichTextBox1 on a form. Set its index to 0. And this is the code needed:

Private Sub Command1_Click()
    Static ind As Integer
   
    ind = ind + 1
    Load RichTextBox1(ind)
    RichTextBox1(ind).Visible = True
    RichTextBox1(ind).Top = RichTextBox1(ind - 1).Top + RichTextBox1(ind - 1).Height + 100
   
End Sub

You may put some Err handling as well.
0
 

Author Comment

by:oreg
ID: 1463050
Thank you for the quick reply.  This worked great,
enjoy the points!

(ps: for anyone else reading this who does not know, unload RichTextBox1([number]) will get rid of the box)

oreg
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no 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 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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now