Click here to Skip to main content
15,891,895 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Error: Object reference not set to an instance of an object Pin
Mekong River14-Oct-04 16:38
Mekong River14-Oct-04 16:38 
GeneralReports/Search/Picturebox and access Pin
stevemwangi12-Oct-04 3:02
stevemwangi12-Oct-04 3:02 
GeneralRe: Reports/Search/Picturebox and access Pin
Mekong River12-Oct-04 3:37
Mekong River12-Oct-04 3:37 
GeneralError : Class Does not support Automation Pin
cberam12-Oct-04 1:02
cberam12-Oct-04 1:02 
GeneralRe: Error : Class Does not support Automation Pin
gthompson200512-Oct-04 1:37
gthompson200512-Oct-04 1:37 
GeneralRe: Error : Class Does not support Automation Pin
Anonymous12-Oct-04 17:21
Anonymous12-Oct-04 17:21 
GeneralVb.net combo box control Pin
me_vb_man11-Oct-04 23:48
me_vb_man11-Oct-04 23:48 
GeneralRe: Vb.net combo box control Pin
J4amieC12-Oct-04 1:40
J4amieC12-Oct-04 1:40 
You may want to take a look at the standard ComboBox as that's the exact functionality.

Here's some code to get you started [Edit: Sorry for the C# didnt realise id swapped forum Wink | ;) ]:

A simple data object
private struct MyDataObject
{
	private string display;
	private object val;
	public MyDataObject(string display, object val)
	{
		this.display = display;
		this.val = val;
	}

	public string Display
	{
		get{ return this.display;}
	}

	public object Value
	{
		get{ return this.val; }
	}
}


I dragged a ComboBox to my form and in the form load event I filled it with 2 elements:

<br />
ArrayList al = new ArrayList();<br />
al.Add( new MyDataObject("Val1",1));<br />
al.Add(new MyDataObject("Val2",2));<br />
this.comboBox1.DataSource = al;<br />
this.comboBox1.DisplayMember = "Display";<br />
this.comboBox1.ValueMember = "Value";<br />


I can then set the selected value of my combo box:

<br />
this.comboBox1.SelectedValue = 2; // shows text "Val2" in the combobox<br />


hope it helps Big Grin | :-D
GeneralRe: Vb.net combo box control Pin
me_vb_man12-Oct-04 5:29
me_vb_man12-Oct-04 5:29 
GeneralRe: Vb.net combo box control Pin
J4amieC12-Oct-04 8:22
J4amieC12-Oct-04 8:22 
GeneralVB.NET editor very slow Pin
Microlan11-Oct-04 21:50
Microlan11-Oct-04 21:50 
GeneralRe: VB.NET editor very slow Pin
Mekong River12-Oct-04 0:09
Mekong River12-Oct-04 0:09 
GeneralRe: VB.NET editor very slow Pin
Dave Kreskowiak12-Oct-04 2:51
mveDave Kreskowiak12-Oct-04 2:51 
GeneralRe: VB.NET editor very slow Pin
Steven Campbell12-Oct-04 7:20
Steven Campbell12-Oct-04 7:20 
GeneralRe: VB.NET editor very slow Pin
Anonymous12-Oct-04 7:49
Anonymous12-Oct-04 7:49 
GeneralRe: VB.NET editor very slow Pin
monmiki12-Oct-04 20:52
monmiki12-Oct-04 20:52 
QuestionVB.NET Error : Unable to Start Debugging on the Web Server ? Pin
Amarelia11-Oct-04 20:39
Amarelia11-Oct-04 20:39 
AnswerRe: VB.NET Error : Unable to Start Debugging on the Web Server ? Pin
Dave Kreskowiak12-Oct-04 2:45
mveDave Kreskowiak12-Oct-04 2:45 
GeneralDo simple database activities in VB.NET Pin
Mekong River11-Oct-04 17:42
Mekong River11-Oct-04 17:42 
GeneralRe: Do simple database activities in VB.NET Pin
Mekong River11-Oct-04 19:05
Mekong River11-Oct-04 19:05 
GeneralReturning data of type BSTR to vb.net Pin
randynamics11-Oct-04 16:22
randynamics11-Oct-04 16:22 
GeneralRe: Returning data of type BSTR to vb.net Pin
Dave Kreskowiak12-Oct-04 0:43
mveDave Kreskowiak12-Oct-04 0:43 
GeneralRe: Returning data of type BSTR to vb.net Pin
Matt Philmon12-Oct-04 18:30
Matt Philmon12-Oct-04 18:30 
GeneralRe: Returning data of type BSTR to vb.net Pin
randynamics12-Oct-04 18:38
randynamics12-Oct-04 18:38 
GeneralRe: Returning data of type BSTR to vb.net Pin
Matt Philmon12-Oct-04 18:52
Matt Philmon12-Oct-04 18:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.