| | |
combobox - remember last selection
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2007
Posts: 2
Reputation:
Solved Threads: 0
My options in my combobox are added from my mdb database... what I need is for each time my form, or program for that matter loads is to have the selected option default to the option that was last selected. So essentially, I need my combo box to "remember" which record was the last one selected by the user. Can this be done, seems like it should be simple but I haven't been able to find the answer.
•
•
Join Date: Apr 2007
Posts: 16
Reputation:
Solved Threads: 0
•
•
•
•
My options in my combobox are added from my mdb database... what I need is for each time my form, or program for that matter loads is to have the selected option default to the option that was last selected. So essentially, I need my combo box to "remember" which record was the last one selected by the user. Can this be done, seems like it should be simple but I haven't been able to find the answer.
I have used vb.net2002 to solve ur problem I hope it will work.
I have used button to show previous selection u may use another thing according to you. The coding is following
Dim Previous As Integer = 0
Dim Current As Integer = 0
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Previous = Current
Current = ComboBox1.SelectedIndex
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox(ComboBox1.Items(Previous))
End Sub
![]() |
Similar Threads
- Using combobox selection to search dataset (VB.NET)
- Clearing a combobox upon selection/focus (Java)
- Source Code that don't work? (Java)
- Issue related to combobox.... (VB.NET)
- Am not able to get a radio button selection to display in output (PHP)
- changing the color of a HTML form selection (HTML and CSS)
Other Threads in the VB.NET Forum
- Previous Thread: adding controls dynamically
- Next Thread: WSDL file EDITING
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2005 2008 access account application array arrays basic beginner browser button buttons center checkbox client code convert cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic eclipse excel fade filter forms ftp generatetags gridview html images inline input insert intel internet lib listview mobile monitor net objects open panel passingparameters pdf picturebox port position print printing problem read remove save searchvb.net select serial settings shutdown soap sorting sqlserver survey table temperature textbox timer timespan transparency trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web webbrowser winforms wpf wrapingcode year






