Click here to Skip to main content
16,019,843 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can I create a component in run-time and show it like as design mode? Pin
silver_ben30-Jun-03 19:38
silver_ben30-Jun-03 19:38 
GeneralInsanely simple interop question. Pin
Bog24-Jun-03 14:06
Bog24-Jun-03 14:06 
GeneralRe: Insanely simple interop question. Pin
Ranjan Banerji25-Jun-03 3:22
Ranjan Banerji25-Jun-03 3:22 
GeneralRe: Insanely simple interop question. Pin
Bog25-Jun-03 9:23
Bog25-Jun-03 9:23 
GeneralOverride OnPaint in TextBox control Pin
paulb24-Jun-03 13:31
paulb24-Jun-03 13:31 
GeneralRe: Override OnPaint in TextBox control Pin
jspano26-Jun-03 14:51
jspano26-Jun-03 14:51 
GeneralArrow keys in user controls Pin
duncanmeech24-Jun-03 12:35
duncanmeech24-Jun-03 12:35 
GeneralTesting for control+enter in a textbox Pin
monrobot1324-Jun-03 12:00
monrobot1324-Jun-03 12:00 
Hi Everyone,

Question: How would I test if someone was holding control while they pressed enter in a textbox?

I'm currently doing this:
int nReturn = Keys::Return;
int nControl = Keys::Control;
int nData = nReturn + nControl;

if (e->KeyData == nData)
Now this code works, but you have to press enter twice while you're holding down control. Does anyone know why? Am I doing something wrong in the code? Another quick question, how would I do all code in one if condition? I tried:
if (e->KeyValue == Keys::Return & Keys::Control)
but get this warning:
warning C4806: '&' : unsafe operation: no value of type 'bool' promoted to type 'int' can equal the given constant
if I put brackets around Keys::Return & Keys::Control it gets rid of the waring, but it still doesn't execute the code in the if block.

I know my code is in MC++, but if you could help (just give your response in C#) it would be very appreciated.

Thanks!

- monrobot13
GeneralRe: Testing for control+enter in a textbox Pin
leppie24-Jun-03 12:42
leppie24-Jun-03 12:42 
GeneralRe: Testing for control+enter in a textbox Pin
monrobot1325-Jun-03 11:26
monrobot1325-Jun-03 11:26 
GeneralCSharp conversion Pin
Member 88602324-Jun-03 10:49
Member 88602324-Jun-03 10:49 
GeneralRe: CSharp conversion Pin
Michael Mac24-Jun-03 12:26
Michael Mac24-Jun-03 12:26 
GeneralRe: CSharp conversion Pin
leppie24-Jun-03 12:30
leppie24-Jun-03 12:30 
GeneralCommon Icons for Buttons and Toolbars Pin
Khang Nguyen24-Jun-03 10:40
Khang Nguyen24-Jun-03 10:40 
GeneralRe: Common Icons for Buttons and Toolbars Pin
John R. Shaw24-Jun-03 12:08
John R. Shaw24-Jun-03 12:08 
GeneralRe: Common Icons for Buttons and Toolbars Pin
Khang Nguyen24-Jun-03 12:41
Khang Nguyen24-Jun-03 12:41 
GeneralC# & Winforms equivilent to AfxMessageBox Pin
Matt Newman24-Jun-03 10:35
Matt Newman24-Jun-03 10:35 
GeneralRe: C# & Winforms equivilent to AfxMessageBox Pin
monrobot1324-Jun-03 11:01
monrobot1324-Jun-03 11:01 
GeneralRe: C# & Winforms equivilent to AfxMessageBox Pin
Matt Newman24-Jun-03 11:32
Matt Newman24-Jun-03 11:32 
GeneralRe: C# & Winforms equivilent to AfxMessageBox Pin
Kant24-Jun-03 11:10
Kant24-Jun-03 11:10 
GeneralRe: C# & Winforms equivilent to AfxMessageBox Pin
Matt Newman24-Jun-03 11:33
Matt Newman24-Jun-03 11:33 
GeneralGetting the size of the main application Pin
monrobot1324-Jun-03 10:04
monrobot1324-Jun-03 10:04 
GeneralRe: Getting the size of the main application Pin
leppie24-Jun-03 10:25
leppie24-Jun-03 10:25 
GeneralRe: Getting the size of the main application Pin
monrobot1324-Jun-03 11:08
monrobot1324-Jun-03 11:08 
GeneralRe: Getting the size of the main application Pin
leppie24-Jun-03 12:09
leppie24-Jun-03 12:09 

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.