Solved

Can this be done, and how...?

Posted on 1998-06-10
3
145 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb.net 2008 2 56
vb6 - Transfer from MSHFlexgrid1 to xls issue 8 45
Problem to With line 4 39
MS Access 03, TransferText, decimal places 8 37
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

914 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

20 Experts available now in Live!

Get 1:1 Help Now