Click here to Skip to main content
15,917,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# code to find Prime Numbers Pin
diabolusgorgon21-May-05 13:27
diabolusgorgon21-May-05 13:27 
GeneralRe: C# code to find Prime Numbers Pin
Robert Rohde21-May-05 20:37
Robert Rohde21-May-05 20:37 
QuestionHow to include HTML Pin
Murtuza Husain Miyan Patel21-May-05 4:13
professionalMurtuza Husain Miyan Patel21-May-05 4:13 
AnswerRe: How to include HTML Pin
DavidNohejl21-May-05 4:22
DavidNohejl21-May-05 4:22 
Generalobfuscator/urgent!!! Pin
rabi kumar21-May-05 1:39
rabi kumar21-May-05 1:39 
GeneralListbox Context Menu Pin
Da`Sooty20-May-05 23:06
Da`Sooty20-May-05 23:06 
GeneralRe: Listbox Context Menu Pin
S. Senthil Kumar21-May-05 0:16
S. Senthil Kumar21-May-05 0:16 
GeneralRe: Listbox Context Menu Pin
Robert Rohde21-May-05 0:26
Robert Rohde21-May-05 0:26 
For this to function you will have to first disable the default functionality. For this set the ContextMenu property of the ListBox to null (which is default when adding it to the form).
Then subscribe to the MouseUp event of the ListBox and add the following code to it:
private void listBox1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
	if (e.Button == MouseButtons.Right) 
	{
		int index = listBox1.IndexFromPoint(e.X, e.Y);
		if (listBox1.SelectedIndices.Contains(index))
			contextMenu1.Show(listBox1, new Point(e.X, e.Y));
	}
}


You can implement every thinkable kind of logic this way. You could even modify the ContextMenu depending on which item was clicked.
GeneralProblem reading stream Pin
AnonymousTwo20-May-05 22:50
AnonymousTwo20-May-05 22:50 
GeneralRe: Problem reading stream Pin
Robert Rohde21-May-05 0:48
Robert Rohde21-May-05 0:48 
Generaljoin DBF files Pin
Bedevian20-May-05 20:07
Bedevian20-May-05 20:07 
GeneralRe: join DBF files Pin
Robert Rohde20-May-05 20:56
Robert Rohde20-May-05 20:56 
GeneralRe: join DBF files Pin
Bedevian20-May-05 23:56
Bedevian20-May-05 23:56 
GeneralRe: join DBF files Pin
Robert Rohde21-May-05 0:15
Robert Rohde21-May-05 0:15 
GeneralRe: join DBF files Pin
Bedevian21-May-05 19:34
Bedevian21-May-05 19:34 
GeneralRe: join DBF files Pin
Robert Rohde21-May-05 20:02
Robert Rohde21-May-05 20:02 
GeneralRe: pass dataset to new database Pin
sevan22-May-05 21:03
sevan22-May-05 21:03 
GeneralShortcut key for C# Application Pin
Anonymous20-May-05 20:05
Anonymous20-May-05 20:05 
GeneralRe: Shortcut key for C# Application Pin
ekynox20-May-05 22:47
ekynox20-May-05 22:47 
GeneralNTFS Folder Security Permissions Pin
ekynox20-May-05 17:18
ekynox20-May-05 17:18 
GeneralWebResponse and UTF8 Pin
Danny Mark20-May-05 16:00
sussDanny Mark20-May-05 16:00 
GeneralDifference between WebClient and HttpWebRequest/Response Pin
Jason Manfield20-May-05 15:19
Jason Manfield20-May-05 15:19 
GeneralRe: Difference between WebClient and HttpWebRequest/Response Pin
minhpc_bk21-May-05 7:34
minhpc_bk21-May-05 7:34 
GeneralClient/Server application question Pin
StephenMcAllister20-May-05 14:48
StephenMcAllister20-May-05 14:48 
GeneralRe: Client/Server application question [edit] Pin
Luis Alonso Ramos20-May-05 14:56
Luis Alonso Ramos20-May-05 14:56 

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.