Click here to Skip to main content
15,887,844 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
Richard MacCutchan19-May-15 7:25
mveRichard MacCutchan19-May-15 7:25 
GeneralRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
Sascha Lefèvre19-May-15 7:52
professionalSascha Lefèvre19-May-15 7:52 
GeneralRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
satc19-May-15 19:03
satc19-May-15 19:03 
GeneralRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
Richard Deeming20-May-15 1:11
mveRichard Deeming20-May-15 1:11 
AnswerRe: Custom ContextMenu for TextBox doesn't disable items when necessary Pin
Terry Dieckmann20-May-15 2:20
Terry Dieckmann20-May-15 2:20 
QuestionVB.net code created by conversion from a working c# code doesn't work Pin
satc18-May-15 23:26
satc18-May-15 23:26 
AnswerRe: VB.net code created by conversion from a working c# code doesn't work Pin
Duncan Edwards Jones18-May-15 23:32
professionalDuncan Edwards Jones18-May-15 23:32 
QuestionCombobox not (re)loading the Datasource Pin
SepPax18-May-15 6:11
SepPax18-May-15 6:11 
I use the following for populating a Combobox.

Dim comboSource As New Dictionary(Of String, String)()
Dim k as string


public sub load CBox()

        comboSource.Add("xxx", "Ex")
        comboSource.Add("yyy", "Ypsilon")
        comboSource.Add("zzz", "Zet")
        ComboBox2.DataSource = New BindingSource(comboSource, Nothing)
        ComboBox2.DisplayMember = "Value"
        ComboBox2.ValueMember = "Key"
end sub


Then from the code, when I need to get the key I use
k = DirectCast(ComboBox2.SelectedItem, KeyValuePair(Of String, String)).Key

and this works til here...

My problem is about the ComboBox2 listed values...
The first time I open the form containing the combobox I get the 3 values correctly listed in it.

But if I close this form and reopen it, the combobox list is empty and the DirectCast(ComboBox2.SelectedItem, KeyValuePair(Of String, String)).Key will not return anything...

Tried many things but can't figure out.

Any help is appreciated.
SepPax

QuestionHow to Upload/preview excel sheet file to Datagridview Control Pin
Urassa, Octallon18-May-15 4:00
professionalUrassa, Octallon18-May-15 4:00 
GeneralRe: How to Upload/preview excel sheet file to Datagridview Control Pin
Sascha Lefèvre18-May-15 4:25
professionalSascha Lefèvre18-May-15 4:25 
AnswerRe: How to Upload/preview excel sheet file to Datagridview Control Pin
Richard MacCutchan18-May-15 4:43
mveRichard MacCutchan18-May-15 4:43 
QuestionApplication fail to close when a control created in runtime is used Pin
satc17-May-15 23:53
satc17-May-15 23:53 
GeneralRe: Application fail to close when a control created in runtime is used Pin
Sascha Lefèvre18-May-15 2:22
professionalSascha Lefèvre18-May-15 2:22 
GeneralRe: Application fail to close when a control created in runtime is used Pin
satc18-May-15 7:11
satc18-May-15 7:11 
GeneralRe: Application fail to close when a control created in runtime is used Pin
Sascha Lefèvre18-May-15 7:53
professionalSascha Lefèvre18-May-15 7:53 
GeneralRe: Application fail to close when a control created in runtime is used Pin
satc18-May-15 17:08
satc18-May-15 17:08 
QuestionRe: Application fail to close when a control created in runtime is used Pin
Eddy Vluggen19-May-15 0:08
professionalEddy Vluggen19-May-15 0:08 
AnswerRe: Application fail to close when a control created in runtime is used Pin
satc19-May-15 6:41
satc19-May-15 6:41 
GeneralRe: Application fail to close when a control created in runtime is used Pin
Sascha Lefèvre19-May-15 8:46
professionalSascha Lefèvre19-May-15 8:46 
GeneralRe: Application fail to close when a control created in runtime is used Pin
satc19-May-15 8:55
satc19-May-15 8:55 
Question/ Pin
LA8888817-May-15 7:00
LA8888817-May-15 7:00 
GeneralRe: Asking advice for IO.File.ReadAllLines Pin
PIEBALDconsult17-May-15 7:07
mvePIEBALDconsult17-May-15 7:07 
GeneralRe: Asking advice for IO.File.ReadAllLines Pin
LA8888817-May-15 7:15
LA8888817-May-15 7:15 
Question[help] vb.net image resizing in picturebox Pin
Member 1169441315-May-15 15:19
Member 1169441315-May-15 15:19 
AnswerRe: [help] vb.net image resizing in picturebox Pin
Eddy Vluggen16-May-15 23:53
professionalEddy Vluggen16-May-15 23:53 

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.