Click here to Skip to main content
13,044,705 members (65,718 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I made a list listbox in code blocks. I want to do something when I click an item such as open a text file or open internet explorer just something anything. I cant figure it out. Here is my code for my list box.

It tells me that I selected item 0 when I select the first item and item 1 etc down the list. It does not allow me to launch internet explorer or do something when I select an item. I am really thinking that code blocks and wxwidgets is a bad idea being that something this simple seems impossible to find info on.

Any help would be appreciated thanks.

void ListBoxFrame::OnListBox1Select(wxCommandEvent& event)
    int sel = event.GetInt();
    wxLogMessage(_T("Listbox item %d selected"), sel);

Also I have tried this and can;t get it to work. I would like to get this method working the most. It is in a c# project trying to convert it to wxlistbox code.

void ListBoxFrame::OnListBox1Select(wxCommandEvent& event)
for (int i = 0; i < ListBox1.Select.Count; i++)
                switch (ListBox1.Select[i].ToString())
                    case "Foobar":
                        wxLogMessage(_T("Listbox item foobar selected"));
                    case "Bazquirk":
                        wxLogMessage(_T("Listbox item Bazquirk selected"));
                    case "Widgets":
                        wxLogMessage(_T("Listbox item Widgets selected"));
                    case "Gadgets":
                        wxLogMessage(_T("Listbox item Gadgets selected"));
Posted 24-Jan-11 1:34am
Updated 24-Jan-11 4:36am
Albert Holguin 5-Feb-11 21:33pm
Can you elaborate on what you mean with the "...does not allow me to launch internet explorer or do something..."? I've never used wxwidgets or code blocks, but under C++ and MFC there would be no problem doing that. What's the actual call that you are trying and does it return any errors?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 24 Jan 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100