ms-access: is it possible to change a combo box to text box using vba? - database

is it possible to change a combo box to text box using vba?

As an addition to the suggestion about hiding the text box I have seen people use a text box to cover all but the dropdown arrow of the combo box (text box set to be on top of course) and then updated the text box on the after update event of the combo box
I forget why they did it that way in the end but it worked and IMHO is better than hiding the combo box as you might have issues with it still having focus

As far as I know there are two methods. If the form is in design mode then running;
Application.RunCommand acCmdChangeToTextBox
while the combobox is in focus will make it turn into a textbox.
However you cannot do this at runtime. Say you want to show a textbox after selecting a value from the combobox, on the Change event of the combobox you just hide it and show a textbox that was previously hidden. Use the visible property of the combobox and the textbox for this.

Related

How to add CheckBoxes to a ComboBox?

I want to create a ComboBox having Checkboxes as children using Codename one.
I am not using the UIBuilder
For reusability I created a Container having three Checkboxes in it:
OverviewCheckBoxContainer
- Checkbox1
- Checkbox2
- Checkbox3
and this works already.
As it takes too much space on the screen, I now tried to add the CheckBoxContainer into a Combobox, like this:
ComboBox
- OverviewCheckBoxCont
-...
but it does not work, the ComboBox contains a single entry only and it's not a checkbox, but a text:
OverviewCheckBoxCont[x=...
(cannot see further on the screen)
How can I solve this issue, so there is a dropdown menu containing the three Checkboxes, that toggle onClick?
ps:
In the main form I added the CheckBoxesComboBox instead of the CheckBoxesCont:
this.add(BorderLayout.CENTER, checkBoxesComboBox)
instead of
this.add(BorderLayout.CENTER, checkBoxesCont)
1.You can use simple combobox as shown below
ArrayList al = new ArrayList();
findComboBox().setModel(new DefaultListModel(al));
2.And to add checkbox in combobox , you have to customize the combobox
3.Instead of customizing combobox, You can use button which shows and hides OverviewCheckBoxContainer which contains list of checkboxs
See this for customizing the ComboBox with the generic list cell renderer: https://www.codenameone.com/manual/components.html#_combobox
The problem with using checkboxes in a combo is that you would assume they would all appear in the combo as a set and the combo wasn't designed to do that. I would instead just use a Button and show a dialog with a set of checkboxes then set the text of the Button to match the result. You can style the button to look like a ComboBox if that is your preference.

Select Combobox with Selenium IDE

In my application I have lot of combo boxes available. I need to click an arrow button which is on combo box. I am using Selenium IDE. When I record the clicking of the arrow button from combo box it will work at that time, but when I come back to same page it will display that the element is not found.
Thank you in advance.
I recommend you to understand first, how values are coming into your combo boxes. I think when you clicked on combo box, AJAX call will be fired and values will be loaded into your combo boxes.
You can use the command "waitForElementPresent" or "waitForTextPresent" when clicked on combo box.
Do not click on combo box button while recording.......
Do right click on button and get element by ID

silverlight combobox - highlight a few items in the popup list

I'm wondering if I can make fake sections in the popup menu:
The rule would be, if the 5th character of the displayed item is different from the 5th char of the previous item in the menu, it has to be highlighted
What do you think?
Thanks!
To achieve this would be a hack.
Normally the items that appear in the popup part of a combo box will be an instantiated data template, and each gets its own data item and has no clue or knowledge of the other items in the list, so you couldn't use a converter or anything else to achieve this behavior.
What you could do though is inject (attach) your own control into the popup part of the combo box, and take over the rendering of the data items. How you do this will depend upon which combo box you are using (i.e. MS or some other vendor's) and would be a whole new question.
Would that be easier if I were to create my own combobox as follow:
a TextBox associated with a Button that when pushed would popup a datagrid in which I could implement this conditional formatting?

Silverlight 3 Combobox Rollover Behaviour

I have a combo box on a form and when I rollover the combo box with my mouse, the OnMouseOver event causes a graident view to appear. How would I go about ensuring that it doesn't do that. What I want is for the combo box to remain white.
What you need to do is create a new Template for your ComboBox. This is easiest to do in Blend; right click on the control and choose to edit a copy of the template.
You will want to remove the animations from the MouseOver VisualState.

Problem with combobox dropdown

I have a problem regarding combobox dropdown. Once a dropdown is opened, if I want to move focus to other control (say a textbox), I need to click twice because on first click, the combo dropdown is closed and then on second click, the textbox gets focus. How should I fix this? Please help.
You could listen to the DropDownList.SelectedIndexChanged event, and in the event handler set focus to the next control, either by setting TextBox.Focus(), or by calling System.Windows.Forms.Control.SelectNextControl()
I think this would be 'non standard' behaviour for what its worth. Its quite normal to expect the user to tab or select the next control after using a drop down.
Edit: Sorry, in a WPF ComboBox the equivalent event is SelectionChanged, but on reflection you'd be better using OnDropDownClosed. This would mean you only move the focus specifically after using the drop down rather than just whenever the value changes.

Resources