View Single Post
  #1 (permalink)  
Old 05-22-2006, 01:53 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 10,967
Last Blog:
Artificial Intelligenc...
Credits: 1
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default ListBox select item by right-clicking

Here is how to select an item in a listbox when right-clicking:

C++
Code:
private: System::Void listBox1_MouseDown(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
          if (e->Button == System::Windows::Forms::MouseButtons::Right) {
          listBox1->SelectedIndex = listBox1->IndexFromPoint(e->X, e->Y);
 }
					
			 }
C#
Code:
private void LST_BX_MouseDown(object sender, MouseEventArgs e) {
   if(e.Button == MouseButtons.Right)
      LST_BX.SelectedIndex = LST_BX.IndexFromPoint(e.X, e.Y);
}
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Reply With Quote