How do I convert a VB 6 TextBox to ComboBox?

280 pts.
Tags:
ComboBox
TextBox
VB 6
Visual Basic 6
Sir, how i convert textbox to combo in vb form

Answer Wiki

Thanks. We'll let you know when a new response is added.

I think you cannot do that conversion at runtime in vb6, but you can create new controls and delete controls, so you could remove the textbox and create a combo at the same position.

You can create a new control this way (a TextBox called ‘Text2′ in this case):

<pre>Dim ctlName As Control
Set ctlName = Form1.Controls.Add(“VB.TextBox”, “Text2″, Form1)
ctlName.Visible = True
ctlName.Top = Text1.Top
</pre>

and you can remove it like this:

<pre>Form1.Controls.Remove (“Text2″)</pre>

Hope this helps.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following