Click here to Skip to main content
15,926,857 members
Home / Discussions / C#
   

C#

 
GeneralRe: Displaying sub Properties in PropertyGrid Pin
leppie10-Jun-02 11:44
leppie10-Jun-02 11:44 
Generaldetecting a key press... Pin
8-Jun-02 16:28
suss8-Jun-02 16:28 
GeneralRe: detecting a key press... Pin
Nick Parker8-Jun-02 18:55
protectorNick Parker8-Jun-02 18:55 
GeneralRe: detecting a key press... Pin
Nish Nishant8-Jun-02 19:25
sitebuilderNish Nishant8-Jun-02 19:25 
GeneralRe: detecting a key press... Pin
Nick Parker8-Jun-02 19:34
protectorNick Parker8-Jun-02 19:34 
GeneralRe: detecting a key press... Pin
Rama Krishna Vavilala9-Jun-02 1:03
Rama Krishna Vavilala9-Jun-02 1:03 
GeneralRe: detecting a key press... Pin
9-Jun-02 5:11
suss9-Jun-02 5:11 
GeneralRe: detecting a key press... Pin
Humpo9-Jun-02 7:24
Humpo9-Jun-02 7:24 
One option is to have a thread that reads the keyboard and have it change the value controlling the while loop when the key you want is pressed.

/ So code could be something like this…
//no idea if this way would work, up to you if want to try it out

static void Main(string[] args)
{
	bool bLoop = true;

	YourThreadedClass ytc = new YourThreadedClass(ref bLoop);
	ytc.Start();

// ytc will check for a key press using System.Console.Read() and change the 
// value of bLoop when the key you want is pressed

	while(bLoop)
	{
	//do something
	}
}


Unfortunately I’m new to C# so haven’t had chance to look at creating threaded classes yet. Also have a feeling doing it this way might be bad style, as it looks like a nasty hack Smile | :)
GeneralRe: detecting a key press... Pin
Rama Krishna Vavilala9-Jun-02 9:58
Rama Krishna Vavilala9-Jun-02 9:58 
GeneralRe: detecting a key press... Pin
Rama Krishna Vavilala9-Jun-02 10:01
Rama Krishna Vavilala9-Jun-02 10:01 
GeneralRe: detecting a key press... Pin
9-Jun-02 11:49
suss9-Jun-02 11:49 
GeneralRe: detecting a key press... Pin
Humpo9-Jun-02 12:04
Humpo9-Jun-02 12:04 
QuestionUse \ in string? Pin
Brian Olej8-Jun-02 12:37
Brian Olej8-Jun-02 12:37 
AnswerRe: Use \ in string? Pin
James T. Johnson8-Jun-02 13:05
James T. Johnson8-Jun-02 13:05 
GeneralRe: Use \ in string? Pin
Brian Olej8-Jun-02 14:22
Brian Olej8-Jun-02 14:22 
AnswerRe: Use \ in string? Pin
Nick Parker8-Jun-02 18:43
protectorNick Parker8-Jun-02 18:43 
Questionfunction pointer in C#? Pin
Todd Smith7-Jun-02 14:36
Todd Smith7-Jun-02 14:36 
AnswerRe: function pointer in C#? Pin
James T. Johnson7-Jun-02 14:59
James T. Johnson7-Jun-02 14:59 
GeneralRe: function pointer in C#? Pin
Todd Smith7-Jun-02 15:12
Todd Smith7-Jun-02 15:12 
GeneralFile I/O Pin
7-Jun-02 13:36
suss7-Jun-02 13:36 
GeneralRe: File I/O Pin
James T. Johnson7-Jun-02 14:03
James T. Johnson7-Jun-02 14:03 
GeneralRe: File I/O Pin
Nish Nishant7-Jun-02 14:11
sitebuilderNish Nishant7-Jun-02 14:11 
GeneralRe: File I/O Pin
8-Jun-02 9:30
suss8-Jun-02 9:30 
GeneralRe: File I/O Pin
Humpo8-Jun-02 10:12
Humpo8-Jun-02 10:12 
GeneralRe: File I/O Pin
James T. Johnson8-Jun-02 10:43
James T. Johnson8-Jun-02 10:43 

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.