Link to home
Start Free TrialLog in
Avatar of rp
rpFlag for Portugal

asked on

Create a textbox from a variable

Hi,

This is not correct, but how can create a textbox for ex. from a variable, somethig like:

            Dim xx As String
            Dim xx As New TextBox()

best regards
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Hi rflorencio;

This is not possible to do. What do you need to do that needs this type of requirement?
ASKER CERTIFIED SOLUTION
Avatar of Ark
Ark
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rp

ASKER

Hi,

I have some "parameters", like startdate, enddate, prductid for ex. to generate reports. But sometimes i only need for ex. startdate and enddate, others only productid, others all them. I alread done a code to generate controls in runtime mode. But my goal is read the "parameter" for ex. startdate and create a textbox control called startdate to get date, etc ...

best regards
Avatar of rp

ASKER

I get it.
You usually create controls dynamically when you do not know beforehand how many controls you coudl need. As an example, if I have a form that has buttons to print reports, and I cannot know when I build application how many reports will be available. This could be done with the technique described by Ark.

In your case however, you know how many controls you might need. In such a situation, it is usually better to create your form as you would, with all the possible controls, but set the the Visible or Enabled property of those that might not be needed to False. The controls are in the form, but the user sees them as inactive (Enabled) or does not see them (Visible).

When, when you need to display information in these controls, simply reset the property to True so that it is activated or visible.