Use Constant Values Upon Selection From ComboBox??
Apr 3, 2010
I have the following constants declared:
Private Const LuxuryRate As Double = 74.84
Private Const FullSizeRate As Double = 48.44
Private Const MidSizeRate As Double = 44.91
Private Const CompactRate As Double = 30.46
And a combobox that lists each option. How can I set an if statement that uses these values if the option is chosen from the combobox? This is going to be part of a calculation performed when the button is pressed.
View 3 Replies
ADVERTISEMENT
Mar 7, 2011
Is it possible to have a different selection of values in the 2nd combobox depending what was picked on the first combobox? For example an American state is picked in the first combo box and the second combo box loads the cities in that state? I'm just using a basic form in Visual basic 2010 there is no database behind it.
View 6 Replies
Mar 18, 2008
How Do I show the values from the dataset to the text box based on the selection from the combobox list i already populated the combobox my code is. [code]
View 3 Replies
Jun 25, 2009
where i can find out constant value used to control the windows. like i'm using wndproc to disable validation and i use constant value for closing of form and that value is &HF060&
i was also looking for constant value for leaving the form. is there any place where i can find out these values?
View 3 Replies
Jun 22, 2012
I need to know the IOCTL constants for the various strings (for example the value of the constant of IOCTL_ATA_PASS_THROUGH). Searching the net I found that those constants are defined in the header Ntddscsi.h but those constant are wrong. For example the constant value of IOCTL_ATA_PASS_THROUGH should be 4D02C while in the header file it is 40B
The question is: where can I find a list with ALL the right values?
I've found [URL].. where there are listed all the codes. the value in Ntddscsi.h is not the "final" value
View 1 Replies
Mar 27, 2011
Is there a way to update source combobox to printer combobox selection?So going from printer1 to printer2 the source will update according to what that printer has to offer.
View 8 Replies
Jun 27, 2012
We are using a custom API in our project which provide an attribute for class fields/members which lets the interface to present a popup of some range values like "On/OFF" and pass the corresponding values of the choice to our code. The attribute requires a string array to know that values.We have many enumerations defined for these ranges,We are thinking to use Enum.GetValues() kind method to get a string array for this method.However, As we know the field declaration do not allow dynamic values in the declaration? so is there any other of doing same thing in efficient way.To clerify the problem i will write the examples below;
Current Working
<RangeLookUp("On:1","Off:2")> Public ASimpleRangeVariable As Integer
While I wanted to do like this or kind of
<RangeLookUp(SomeMethod())> Public ASimpleRangeVariable As Integer
Public Shared Function SomeMethod() as String()
'use Enum to get all the items as string values forexample Enum.GetValues & enu,.GetValues [code]....
Where SomeMethod suppose to return string array to be passed in the RangeLookup constructor.Which means if we change enumeration then we don't have to update the declaration.i know there are better ways to do it but due to some custom API, the ground is limited.
View 1 Replies
Feb 22, 2012
I'm having a problem with combo boxes. I usually use Java and it's been awhile since I used VB but I never remember having this much difficulty.My application is using an SDF file. From Data Sources, I drag the details on one of my Tables to my Form to get all of the fields. Three of them are comboboxes. Each of the three is an INT64 and each corresponds to a primary key in a different table. I click the tasks button on a combobox and for data source I select the appropriate table that has the data to go with the combobox, for display member I select the field that I want users to see, and for value member I select the primary key. Then I run a quick test and start the app, open the form, and add a new record. When I select a value from the combobox the selection won't validate because it doesn't think it's an INT64 like it should be. It seems to be using the display member as the actual value instead because if I change display member to the primary everything works great.
View 11 Replies
Jan 15, 2012
I have two comboBoxes, one is CountryCombo and second is StateCombo.What I want is the that when i the clicks country combo and select a one country then the States of that the country should get populated in the State Combo.I have tried things many many many but nothing working. Below is my code of how my CountryCombo is getting filled.
query="select CountryName from CountryMaster"
if dr.hasRows()
{[code]......
View 3 Replies
Mar 30, 2012
When developing ASP.NET websites (using VB.NET web forms) - a lot of my time is spend writing CSS files and they always seem to get messy (code duplication) and very long.
All I want to achieve is to be able to manipulate the CSS using VB.NET code in the following ways:
Use an integer variable to store my "golden" number 7 and use that for width, padding, margin etc where needed
Use string variables to store my "golden" hex color codes e.g. "#44C5F2" and use them for color, background-color, border-color etc. where needed Use an integer variable to set the height of an element and have four child elements each with height: mynum / 4
I just want to use basic VB.net number and string manipulation in order to create a CSS file on the fly.
I understand that the end product - the CSS file shouldn't change much - it should at most change on a daily basis otherwise caching couldn't be used.[code]...
View 3 Replies
Jan 1, 2012
I currently have a form with two comboxes. The first cbo is being populated with a project number, which is being pulled from the first column of a spreadsheet. I now want the second cbo to read the first cbo and then find that project number on the spreadsheet; when it finds that project number, I then need it to copy data from the row the project number is on. I have converted to vb from vba. Below is the code I used in vba (which obviously does not work). I only need certain cells from the project row.
Dim proj_num, rng As Range
Dim data, i As Long, j As Long
With Sheet1
[code].....
View 20 Replies
Aug 13, 2011
When building a class library which contains many classes, all classes uses a lot of common constants and functions, what is the best to do:
1- Declare these constants and functions as public in a module.
2- In each class declare constants and functions used by individual class as private.
The first choice is good for easy and fast implementation, but re-using a class in a different project will require importing the module to the other project.The second choice require a lot of copy/paste for code snippet but a class can be re-used in different project easily.
View 3 Replies
Aug 15, 2011
i have used the following code to populate a DataGrid based on the contents of a textbox. the users searches for a name which is populated into a combobox based on the name in the combobox several textboxes are populated with data based on the data in one of these text boxes Private bindingSource1 As New BindingSource
[Code]...
View 9 Replies
Jan 28, 2012
I have put all of the items from my Database into a Checkbox Selection, I now want to take the selection that the user makes from the checkbox and turn that into a string that I can then COMPARE through antoehr table.[code]...
View 7 Replies
Mar 26, 2009
Load a combobox with a selection from another?[code]....
View 2 Replies
Jun 18, 2012
Basically, I need a combobox populated by data in a table column that I have created.The user will need to be able to pick more than one option.
For example:
Pizza Topping
+ onion
[code]......
View 3 Replies
Jan 18, 2011
I know this seems like a .Net 101 question but everybody has their own way of programming and I'm curious as to what is the preferred event for checking a ComboBox when a user makes a selection?
View 2 Replies
Feb 6, 2012
I have a vb application sitting on an sql server with 4 different tables. I want a scenario where when I select any table from the combobox, every query I will run should use that table as a reference.
E.g. ComboBox values(tables)=A,B,C,D
If A is selected then
SQLQuery="Select * from A "
If B is selected then
SQLQuery="Select * from B " etc
View 3 Replies
Apr 20, 2009
On my form I have three fields and a datagrid view.One field is a combo box.All fields are databound.The datagridview is a detail grid, bound in the "normal" way. Scrolling through records, etc., all work fine.What doesn't work is when a selection is made using the combo box.The underlying table has a self-join of one-to-many: ParentID, ChildID. ChildID is the main ID for the underlying table.Children may have a parent This is just by way of example.So, the combo box's Value is bound to ChildID, and the SelectedValue is bound to the ParentID.On the form one chooses the Parent with this combo box.When I test this arrangement, I select a Parent, then click Save (using the default toolbar actions). However, the combobox seems to "reset" the selection to the first in the list.
View 1 Replies
Jan 22, 2012
I have a ticketing system that reads a MS 2003 MDB. I can easily fill the DataGrid view with all of the items on the data set How ever I need to be able to have agents filter the rows by login(key)
I have a large list
made this way
csrLogin.Add("james", "TomJim")
I select agents on the menu strip and the combo box populates all the names in that collection (combo box displays TomJim in this instance
I have an SQL query made (I think it is correct)
[Code].....
View 2 Replies
Nov 26, 2009
I have a combobox with multiple names. When I select one of the names from the combobox I want to display a value(number) instead of the name itself. How could I do that?
View 3 Replies
Nov 22, 2009
Wanted users to choose two options 1.(tick) 2 blank text so they can write things.
Was thinkin how this can be achieved using a comboBox. ?
View 1 Replies
Sep 18, 2010
I cannot seem to load the saved .rtf document into the richtextbox when i click on that file in a combobox. I checked msdn and tried what it suggested, but got no results.
View 1 Replies
Feb 3, 2009
I have a combo box that has multiple options, when the user selects one of the options (world wide city destinations) a specific value is assigned to a variable. For example if "New York" is selected the variable "x" is assigned the number 155. What I want to do is output the destination that has been selected ie "New York" in a label called "lblOutput1", do I need to store the destination as a seperate variable to be able to produce it in this label as I cannot seem to get it to work:
At the moment I am using:
lblOutput1.Text = "bla bla bla " + cmbDestination.SelectedText + " bla bla bla " + Today()
View 6 Replies
Apr 9, 2012
How can i bind a comobox selection to a datagridview without writting code...
i Need to select an item from a combox and based on that item refresh the datagrdiview. I did something like that in Access but i don't know how to make it work in visual studio 2008.
once i select the datagridview itme that i want to edit i'd like to be able to update back to the database. I know i need to write code for this but at least i'll have the data refreshed on the datagridview.
View 3 Replies
Jun 17, 2010
I have an app I'm working on with multiple forms. One of the forms, frmLocationInfo, has textboxes and comboboxes which are automatically populated based on a combobox selection from a previous form, frmLocations. I've been able to get any changes made to frmLocationInfo's textboxes to save to the SQL database, however, when attempting to select a different item from any of its comboboxes, it's not saving to the database and instead, I receive a "Procedure or function...has too many arguments specified" error.
Here is the code for the Save button:
'Save changes to Locations db
Private Sub btnSaveClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
[code].....
View 14 Replies
Jan 23, 2012
I have a Win Forms app written in vb.neIn it, I have a combo box with an OwnerDraw Item routineUsing this routine, I am able to implement an application-wide default value for a selection color like shown below:This works great except for one tidbit:ction color again in teh textbox portion of the control
View 5 Replies
May 28, 2012
I have a DataGridView with two columns. One is DataGridViewComboBoxColumn and other is DataGridViewButtonColumn. To capture the button click from the DataGridViewButtonColumn, i have written the CellClick event and it is working fine. However, this is not making my selection from the DataGridViewComboBoxColumn 'smooth'. What i mean is that i have to click on the combo-box twice for it to show the drop-down list. I have noticed that at every click, CellClick is fired. But only after the second click the drop-down pops out. What is the work-around for this?
View 1 Replies
Aug 19, 2011
I have a combobox on a form with the dropdownstyle set to drop down. Users can either salect a value from the list, or type in any value they wish. This all works fine. However, when one particular item in the list is selected I wish to set a different value. Unfortunately I don't appear to be able to set the combobox Text property from within any of the events that fire when the selected item is changed.
[Code]...
View 6 Replies
Jul 16, 2009
I have a ComboBox, and I have a GroupBox. What I want is for the content of the GroupBox to change when I change the selection of the ComboBox.
View 6 Replies