473,699 Members | 2,428 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 9390
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
4324
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
1952
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 co-ordinated by a BindingManagerBase (bmInfo). When a different "name" item in the ComboBox is...
1
2002
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 property of the DefaultView on the table where the text comes from. If no text exists (that is, no...
3
6710
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
19860
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
4563
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 combobox.
7
26198
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
2307
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
5703
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 = "StructureName"
0
9199
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9055
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8945
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8902
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7787
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4392
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4641
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3075
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

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.