Click here to Skip to main content
15,923,120 members
Home / Discussions / C#
   

C#

 
Question3D Solid geometry library Pin
Hari_10101-Jul-08 21:26
Hari_10101-Jul-08 21:26 
AnswerRe: 3D Solid geometry library Pin
ajtunbridge2-Jul-08 2:48
ajtunbridge2-Jul-08 2:48 
QuestionDrawing line object in custom user control [modified] Pin
cocoonwls1-Jul-08 21:21
cocoonwls1-Jul-08 21:21 
AnswerRe: Drawing line object in custom user control Pin
Harvey Saayman1-Jul-08 22:33
Harvey Saayman1-Jul-08 22:33 
GeneralRe: Drawing line object in custom user control Pin
cocoonwls2-Jul-08 16:38
cocoonwls2-Jul-08 16:38 
GeneralRe: Drawing line object in custom user control Pin
Harvey Saayman2-Jul-08 20:58
Harvey Saayman2-Jul-08 20:58 
QuestionUsing SAPI 5.1 for multiple languages like french Pin
Venkatesh.P1-Jul-08 20:20
Venkatesh.P1-Jul-08 20:20 
Questioncrystal report Pin
cse.vidhya1-Jul-08 19:17
cse.vidhya1-Jul-08 19:17 
AnswerRe: crystal report Pin
Paul Conrad1-Jul-08 19:53
professionalPaul Conrad1-Jul-08 19:53 
GeneralRe: crystal report Pin
cse.vidhya1-Jul-08 19:57
cse.vidhya1-Jul-08 19:57 
QuestionChange values of pixels Pin
gigahertz2051-Jul-08 18:49
gigahertz2051-Jul-08 18:49 
AnswerRe: Change values of pixels Pin
stancrm1-Jul-08 20:12
stancrm1-Jul-08 20:12 
Questionc# barcode reader using scanner Pin
lankaudaranga1-Jul-08 17:51
lankaudaranga1-Jul-08 17:51 
AnswerRe: c# barcode reader using scanner Pin
Bert delaVega1-Jul-08 18:18
Bert delaVega1-Jul-08 18:18 
AnswerRe: c# barcode reader using scanner Pin
killabyte1-Jul-08 18:21
killabyte1-Jul-08 18:21 
AnswerRe: c# barcode reader using scanner Pin
John Ad1-Jul-08 18:23
John Ad1-Jul-08 18:23 
QuestionRunning your programs on other machines Pin
max292971-Jul-08 16:23
max292971-Jul-08 16:23 
AnswerRe: Running your programs on other machines Pin
Christian Graus1-Jul-08 16:24
protectorChristian Graus1-Jul-08 16:24 
GeneralRe: Running your programs on other machines Pin
max292971-Jul-08 16:28
max292971-Jul-08 16:28 
GeneralRe: Running your programs on other machines Pin
Christian Graus1-Jul-08 16:37
protectorChristian Graus1-Jul-08 16:37 
GeneralRe: Running your programs on other machines Pin
max292971-Jul-08 16:41
max292971-Jul-08 16:41 
GeneralRe: Running your programs on other machines Pin
Christian Graus1-Jul-08 17:24
protectorChristian Graus1-Jul-08 17:24 
GeneralRe: Running your programs on other machines Pin
max292971-Jul-08 17:31
max292971-Jul-08 17:31 
QuestionTextbox/Combobox question Pin
JimWWhite1-Jul-08 14:26
JimWWhite1-Jul-08 14:26 
AnswerRe: Textbox/Combobox question Pin
Anthony Mushrow1-Jul-08 14:48
professionalAnthony Mushrow1-Jul-08 14:48 
The events Enter and Leave are for when the control gains/loses focus. So using those you could change the colours of your boxes.

You can use the event KeyDown to see what key the user has pressed before it's actuall passed to the text box so you can hadle your tab/enter keys there.

As for clearing the contents on the first key press, you'll just have to use a bool to check if its the first key press or not.

bool first = false;
OnEnter()
{
  //change colours
  first = true;
}
.
OnLeave()
{
  //change colours back
}
.
KeyDown(KeyEventArgs e)
{
  if(key is tab OR key is enter) {
    e.Handled = true;
    MyForm.Focus(); //should give the form focus, OnLeave event should fire
   }
.
  if(first)
    //clear data
.
  first = false;
}


My current favourite word is: I'm starting to run out of fav. words!
-SK Genius

Game Programming articles start -here[^]-

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.