VS 2008 - Choosing Between Multiple Comboboxes?
Nov 17, 2010
I have a program issue I am trying to work on. I have multiple comboboxes(12 total) on a form.I am attempting to update some settings from what ever the user selects from the combo boxes. I am trying to keep the code as small as possible, so I thought about having all the comboboxes have similar names only different by a number being changed at the end. (ex: cbo_1, cbo_2, cbo_3, etc...)And using a For next loop to advance through each combobox and update the settings as the for next loop advances.(This might be a stupid way of doing it, but its the first idea that came to mind.)
[code]...
View 1 Replies
ADVERTISEMENT
May 21, 2010
I have 7 radioButton options that allows the user to select which "Group" of guitar tuning they want. For example "General" and Dropped" Tuning". When the user selects rbGeneral a comboboxTuning gets items.add ("Standard") and others added to it. The same goes for when the user selects "Dropped": the comboboxTuning gets filled withe different terms. The problem is....I cannot figure out how to clear out the combobox.items (text) when switching between "Group" radio buttons. So, the comboboxTuning just keeps filling up.
View 4 Replies
Feb 15, 2011
This post is a continuation of my other post concerning 'List(of) with multiple comboboxes refill problem.'. I threw the list overboard and began anew with a Dataview.
So far I (finally) managed to get 2 comboboxes (will be more, but if it works for 2...) loaded with the same data using different dataviews (DataView1 & DataView2) so I can select a value from each combobox without the other following the selection.
But now I want to filter out the selected value from the other combobox.
This also works.
The only thing is this: If I select in combobox1 the value 3, and select in combobox2 the value 4, combobox1 will change to the value 2.
If I select in combobox1 the value 2, and select in combobox2 the value 1, combobox1 will change to the value 3.
It works also the other way arround. I can't seem to get my hands around the problem..
Does somehow the index of the items in the combobox play's part? I don't use the selectedIndex, so from my point of view it can't be..
The code I use:
(with the item 0 as 'neutral' option)
Public Class Form1
Dim dTable As New DataTable
[Code].....
View 4 Replies
Feb 10, 2011
I'm trying to make a program in which I can import an excel file, read the whole thing and save it in another format. So far so good: can import the file, read it, skip first line or not etc.But.. Now I've been thinking about a sort option.What if the column order of the excel file is in another order than the export file must be in. In stead of opening the excel file and rearrange the columns manually, I would like to sort it in the program. Just for the sake of trying to make it work and gain experience
So, i read the first line which contains the column names and put them in several comboboxes where I can make a selection. No problem here.Now, the selection of combobox1 has to be removed from the other comboboxes and so on, to avoid double selections on one column. That's where my listOld comes in. Everytime a selection is made in a combobox, a sub is called to create the listOld and create the listNew (which contains items you can still choose from).As I make more selections the listOld gains more items and the ListNew grows shorter.But here comes the part where I'm puzzled.In the part "refill the comboboxes" (bottom part) when I disable "cmb2.Items.Clear()" the listOld (previous selected items) contains all selected items correctly.
[Code]...
View 1 Replies
Apr 1, 2011
I am writing a .NET program which will run on a computer with several IP addresses. The program makes HTTP requests to given web addresses. I want to choose which IP address I use (so I can determine which IP address will appear on the log of the other server).
View 1 Replies
Aug 2, 2011
I have 3 comboboxes and want to populate each from XML. What is the best way to do this?Here is the XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<combobox name="cbScreenResolution">
[code]....
View 5 Replies
Jan 25, 2011
I have the following problem, a table "table1" contains 10000 telephone numbers, this table is source for 5 combo box contained in a form, I need that when I select the first tel N in the first combo, this number is not any more available for the combo 2, when I select the second number in the second combo, the first 2 numbers of the table 1 are not any more available for the combo 3 etc. Every record (in form) contains 5 combo. The Tel N selected into the combo are source for other table called "table2". I've try with all the type of query between table 1 and table 2, and use the result as source for the combo, I've try with IIf but this is works only for the first combo.
View 3 Replies
Jan 29, 2012
I am trying to move over vb6 code that worked through arrays of comboboxes.I have a panel that has 18 comboboxes that each need to be populated the same.I first clear the combo boxes and it loops through them, but keeps going until it gets an error.Likewise on sFillLotNO, it adds the first foundrow to each but bombs out when it tries to get the 19th.[code]
View 2 Replies
Apr 21, 2009
I have two combo boxesthat use the same collection for their datasource. The data member and value member are also the same properties. When the form loads, and I select an item in one of the combo boxes, the same item is then selected in the other combo box. I want the combo boxes to work separately. Do I need to have two different collections, even though they would have the same data in them?
cboInboardKnife.DataSource = cKnives
cboInboardKnife.DisplayMember =
"Name"
cboInboardKnife.ValueMember =
"ToolID"
cboOutboardKnife.DataSource = cKnives
cboOutboardKnife.DisplayMember =
"Name"
cboOutboardKnife.ValueMember =
"ToolID"
View 1 Replies
Apr 9, 2009
I want to maintain a list of potential ComboBox values over multiple executions of my program, and to use that list as the DataSource on multiple ComboBoxes. I also want changes made to the DataSource to propagate over all of the ComboBoxes already existing in the application.
Can someone recommend what type of object I should use as my DataSource, as My.Settings objects don't seem to support generic list objects.
Also, along with that recommendation, can I also ask for suggestions as to how to propagate the updates of the collection to all ComboBoxes? I would imagine I need a collection type which raises events when its contents change, but I can't think of any, and in any case do not know which are compatible with My.Settings.
View 1 Replies
Feb 22, 2010
I have 16 comboboxes with a naming convention of:
c1d2
c2d2
c3d2
c4d2
c16d2
These will all contain the same items and I need to add them at runtime. I know how to loop through the controls, but not sure how to make sure I'm only editing the correct comboboxes. (I will have to do this for 2 more sets of comboboxes with similar naming conventions as well)
View 4 Replies
Dec 8, 2011
I f I have 1 combobox then my SQL query will be:
Dim objConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:DB.mdb;Jet OLEDB:Database Password=Pass1;")
Dim objdataadapter As New OleDbDataAdapter("SELECT DISTINCT LOCATION FROM Table", objConnection)
View 5 Replies
Oct 17, 2011
I have created a form with three comboboxes. means
FirstNameComboBox
MiddleNameComboBox
LastNameComboBox
All fields are select ( name ) from a "CustomerName" table. "CustomerName" table is have more than ten thousand records. I am use three binding sources its worked great but it is very slow bcz three comboboxes are filled data on form loading time. I am using visual studio 2010 (visual basic).
View 8 Replies
Jul 16, 2010
I have multiple combox boxes,
A B C
Combobox B has items Fruit, Veg, Dairy
Combobox C needs to contain 3 list and depending on what value is selected in Combo Box B.
For example,
If I select Veg in Combo Box B, I would like to have a drop down list containing "tomatoes, lettuce, onion,..........."
If I select Dairy in Combo Box B, I would like to have a drop down list containing "Milk, Cheese...................."
View 8 Replies
Apr 24, 2012
this is a subset of a previously posted problem, I have narrowed down my issue and am reposting a question from this thread: [URL] I have apparently confused the compiler by renaming some comboboxes in Visual Basic .net express? (See relevant code below) I think the confusion is in who should handle what, with two routines named with variations of ComboBox1 and one handling the other ( it confuses me just trying to interpret it mentally):
[Code]...
View 5 Replies
Jun 17, 2011
I am new in visual basic and I came up with a problem. I have text file with names in it and I want in a textbox everytime the user hits a button randomly choose a name from it.
View 1 Replies
Oct 28, 2011
I have a form with 4 comboboxes and a button. The first combobox is enabled, but the rest of the controls are disabled. When the form is opened I fill the first combobox (cbxMethod) with a datatable. When the user selects something in cbxMethod the next combobox (cbxStudy) will be filled and so on. When the last combobox (cbxAnalyte) has a selected value I want to enable the button and give it focus so the user can move forward with the program. I basically want to force the user to move from one combobox to the other, until all are filled.I am currently using the SelectionValueChange event, but this event only fires when the user changes the value with their mouse or hits the Enter key, not when the user hits the Tab key.
Public Class frmCalculatedAnalyte
Private cv_dt As New DataTable
Public Sub New()
[code]....
View 8 Replies
Mar 18, 2011
vb
Imports System.Net.WebClientImports System.IO Public Class Form1 Dim link As String Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
[code].....
View 2 Replies
Oct 18, 2010
I have a project where the dropdowns for the Form and controls (left side) and the events (right side) aren't available. I can re-boot, open and close the project or solution and still they do not show. They do show for other projects.how to make them come back?
View 3 Replies
Oct 3, 2011
I have problem with a datagridview with combo boxes firing unwanted events handlers.I have a datagridview with 4 columns all data bound. All of these columns have comboboxes. Column 2,3,4 has a custom generated combobox with code with on the 'DataGridView_EditingControlShowing event' and have event handlers (Dropdown,selected Etc). (Data in the custom generated comboboxes needs to be filtered and worked on)
[Code]...
View 2 Replies
Apr 7, 2011
I need to build a SQL statement.
I have 3 ComboBoxes that i need to use for my SELECT statement. This means that if the user selects ONE of them the SQL statement will be different than when he chooses TWO or THREE.
If none is select, then ALL data is displayed.
View 6 Replies
May 11, 2012
I have 3 Combo boxes that have number 1-9 in each, i would like to make it so that if the first one is set to 9 then the and the second it set to 8 then the first 1 is set to 1, i need them to only equal 9 through all the boxes?
View 6 Replies
Nov 1, 2009
I need to select all the comboboxes on a form with a for each loop. I have about 19 comboboxes and I need to select each one. I tried to do
for each box as combobox in me.controls
But that gave me an error and i now tried this:
for each box as control in me.controls
if box.name.contains("ComboBox") then
...
end if
next
That selected only the comboboxes but the problem is i need to access some data that is specific to comboboxes (aka the selected item(s), if its blank) but those properties are not present since "box" is a control, not a combo box.
View 1 Replies
Aug 20, 2009
1) Does this code make text the selected items text? If it doesnt then how would I do that?Dim text As String text = ListBox1.SelectedItem.ToString()
2)How would I make it so that if in combobox.items there is an item with the same text as the listbox selecteditem it is removed? This is what I have and it doesnt work.
If ComboBox3.Items.Item(text) Then
ComboBox3.Items.Remove(text)
End If
View 3 Replies
Nov 28, 2010
I have a ComboBox with several names within it. The names are sourced from a database. Once the user has selected a name from the ComboBox, he must input the no. of hours from another ComboBox and then he is able save it to a .txt file through a streamwriter.
Here is a little image I just put together:I want the file name of the .txt file to be whatever is selected from the first combobox. So, by using the example shown above, the file would be called bob.txt. Is this possible?There shouldn't be any save file dialog or anything, I want it to be automated and the name of the .txt file to be selected from the ComboBox.
View 2 Replies
Jun 13, 2010
I have a combobox on my main form and it lists geographical locations that the user creates. How do I make the combo-boxes on the sub forms match the one on the main form?
View 1 Replies
Sep 3, 2009
Is there a simple way to make all comboboxes on a form to be readonly upon form load?
Rather than doing:
ComboBox1.ReadOnly = True
Combobox2.ReadOnly = True
And so on...
View 29 Replies
Jan 23, 2009
I'm trying to make a program that'll play the card game "War". I've started to code the dealing process, but it doesn't seem to be working. I currently have 3 comboboxes on the form each with numbers representing different cards, 1 that contains all the cards to be dealt, 1 that contains the user's cards, and 1 that contains the computer's cards. I plan to just draw random numbers from these comboboxes for the dealing. However, nothing happens when I click the tool-strip button that's supposed to deal the cards. [Code]
View 5 Replies
Jan 31, 2009
I want to disallow changes to two comboboxes unless the user first clicks a LOCK symbol on the screen. I pop a Y or N into the tag of the picture box when they click it...I've got this - combobox is called LanguageTo
Private Sub LanguageTo_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LanguageTo.Enter
If Me.languageLock.Tag.ToString = "Y" Then
MessageBox.Show("Click LOCK symbol to allow changes to the Language Pair!", "Language is Locked!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
[code]....
How do I "cancel" the attempt to change that combobox?I don't want to ENABLE=FALSE the combobox - as I don't want it's image to visually change. I want to allow them to attempt the change and then abort it if they didn't unlock first.
View 2 Replies
Nov 17, 2010
how to get different backcolors and how to change them using ListView.ItemCheck.
I am using ListView in a self written control (basically to improve padding). In some deployments, CheckBoxes is set to true and I use a RaiseEvent to return the Index of the row selected using an ListView_SelectedIndexChanged event.
In other deployments, I am using the control with the CheckBoxes set to false. But clicking on a row does not fire the ListView_SelectedIndexChanged event to be able to use RaiseEvent to return the Index of the row chosen. I have tried using a MouseUp event to capture the mouse Y coordinate. But conversion of that coordinate to an Index position is both inconsistent and inaccurate with my primative code of
return = (point.Y - me.top) / some constant
I have used ItemHeight on a ListBox in a similar situation but ListView does not have an ItemHeight property.
how I can capture the Index of a row clicked in a ListView without checkboxes?
View 8 Replies