473,574 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programatically convert a textbox to combobox and back

38 New Member
is there anyway to programatically in VBA code convert a textbox to a combobox (set it's control source) and then later convert it back to a text box?

Much appreciated.
Salzan
Feb 15 '08 #1
3 9385
ADezii
8,834 Recognized Expert Expert
is there anyway to programatically in VBA code convert a textbox to a combobox (set it's control source) and then later convert it back to a text box?

Much appreciated.
Salzan
I'm pretty sure the appropriate Commands to do the conversion would be:
Expand|Select|Wrap|Line Numbers
  1. Application.RunCommand acCmdChangeToComboBox
  2. Application.RunCommand acCmdChangeToTextBox
The problem as far as I understand it would be that the Form containing the Control must be in Design View, and you would need some Method that would shift focus to the Control before the Commands are applied. Just for curiosity, why would you want to do this? Wouldn't it be simpler to overlay the Controls, then manipulate them in this manner?
Feb 15 '08 #2
salzan
38 New Member
Thank you very much. WHile I was waiting for a reply I got the idea to create two controls and overlay them and then make one or the other visible depending on which one I want to show. So in effect I took your advise. Thanks.
Feb 15 '08 #3
ADezii
8,834 Recognized Expert Expert
Thank you very much. WHile I was waiting for a reply I got the idea to create two controls and overlay them and then make one or the other visible depending on which one I want to show. So in effect I took your advise. Thanks.
You are quite welcome, I really don't think that you would want to use the prior approach.
Feb 15 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
4294
by: Paul Slavin | last post by:
I have a textbox bound to a dataview, when I update the text in the textbox no changes take place in the underlying dataset. Why is this?? any answers appreciated, as to due to the underlying structure of the datasets, i.e lots of child tables etc, I cannot use bindingcontext
0
1949
by: Ken Arway | last post by:
Using .Net framework 1.1 I've got a Windows Forms application with a tab control having four tab pages. TabPage4 contains a Combobox and a TextBox, which are bound to the same XML file as a DataSource. The ComboBox displays the values from the "name" column of the DataSource and the TextBox displays the "location" value. The two controls are...
1
1998
by: Johann Blake | last post by:
I have a form with a single textbox control which is bound to a DataRelation in a typed dataset. The textbox displays the name of the product depending on the language selected from a combobox. When you select a different language, the textbox must show the name of the product in the selected language. This is done by setting the RowFilter...
3
6704
by: Vu Doan Hung | last post by:
I want to change this Class to VB.NET Class, can you help me ? using System; using System.Windows.Forms; using System.Drawing; using System.Data;
2
19841
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
7
4555
by: Simon Verona | last post by:
I posted this in dotnet.languages.vb.controls but thought I'd post here as well.. I have a combobox that is bound to a dataview generated from a dataset. The dataset has a single table (called "Data") with two columns "Id" and "Description". Id contains a code and description contains the description that is displayed in the...
7
26192
by: hung tran | last post by:
Hi, I'd like to drop down a combobox after validating the Leave() event, how can I do that ? Thanks
5
2303
by: Elainie | last post by:
I would like to convert data numbers to text.... i.e. 1 = Inactive 2 = Due 3 = Received 4 = Problems 5 = Cleared Their is numbers in the fields at the moment but they need to be converted to the words.... I have tried everything that I can think of at the moment.... if anyone can help.
5
5698
by: Crazy Cat | last post by:
Hi all, I have combobox that is bound to a custom object collection thusly Dim collection As List(Of StructureType) = StructureType.FindStructureTypes(SharedObjects.StructureTypes, DropDownListStructure.SelectedValue, DropDownListType.SelectedValue) DropDownListSubType.DataSource = collection DropDownListSubType.DisplayMember =...
0
7742
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8089
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8260
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6493
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3765
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3783
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2257
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1092
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.