Click here to Skip to main content
15,891,907 members
Home / Discussions / C#
   

C#

 
AnswerRe: Getting DBMS/Database server list using C# Pin
Henry Minute1-Sep-09 4:17
Henry Minute1-Sep-09 4:17 
GeneralRe: Getting DBMS/Database server list using C# Pin
AhmedMasum1-Sep-09 4:28
AhmedMasum1-Sep-09 4:28 
GeneralRe: Getting DBMS/Database server list using C# Pin
Henry Minute1-Sep-09 4:38
Henry Minute1-Sep-09 4:38 
GeneralRe: Getting DBMS/Database server list using C# Pin
AhmedMasum2-Sep-09 3:29
AhmedMasum2-Sep-09 3:29 
QuestionMemory leakage in c# multithreading application windows service application Pin
susantasamanta851-Sep-09 3:42
susantasamanta851-Sep-09 3:42 
AnswerRe: Memory leakage in c# multithreading application windows service application Pin
DaveyM691-Sep-09 3:46
professionalDaveyM691-Sep-09 3:46 
AnswerRe: Memory leakage in c# multithreading application windows service application Pin
Dave Kreskowiak1-Sep-09 5:12
mveDave Kreskowiak1-Sep-09 5:12 
Questionwebbrowser stealing focus Pin
yeah10001-Sep-09 3:14
yeah10001-Sep-09 3:14 
AnswerRe: webbrowser stealing focus Pin
OriginalGriff1-Sep-09 3:38
mveOriginalGriff1-Sep-09 3:38 
GeneralRe: webbrowser stealing focus Pin
yeah10001-Sep-09 3:42
yeah10001-Sep-09 3:42 
GeneralRe: webbrowser stealing focus Pin
OriginalGriff1-Sep-09 4:24
mveOriginalGriff1-Sep-09 4:24 
GeneralRe: webbrowser stealing focus [modified] Pin
yeah10001-Sep-09 19:35
yeah10001-Sep-09 19:35 
QuestionPrevent the ^ character from beeing entered in textbox. Pin
xkrja1-Sep-09 3:10
xkrja1-Sep-09 3:10 
AnswerRe: Prevent the ^ character from beeing entered in textbox. Pin
stancrm1-Sep-09 3:27
stancrm1-Sep-09 3:27 
AnswerRe: Prevent the ^ character from beeing entered in textbox. Pin
OriginalGriff1-Sep-09 3:31
mveOriginalGriff1-Sep-09 3:31 
Couple of things:
1) KeyUp is probably not a good place to disable keys, as KeyPress happens repeatedly before KeyUp occurs. Try handling KeyDown, KeyPress and KeyUp with Console.WriteLine in each to show the flow of events.
2) If you are going to use magic numbers then comment the damn things so the next poor sod stands a chance of understanding what you are doing:
// Disable '%' key
case 52:
is a lot more useful than
case 52:
By preference, use '%' instead of magic numbers, or constants with sensible names, or even "Keys."
3) Use KeyPress to disable your code:
private void textBox_KeyPress(object sender, KeyPressEventArgs e)
    {
    if (e.KeyChar == '^')
        {
        e.Handled = true;
        }
    }


No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

GeneralRe: Prevent the ^ character from beeing entered in textbox. Pin
xkrja1-Sep-09 3:37
xkrja1-Sep-09 3:37 
GeneralRe: Prevent the ^ character from beeing entered in textbox. Pin
Henry Minute1-Sep-09 4:23
Henry Minute1-Sep-09 4:23 
Questionclient side validation for server control Pin
dotnetcsharpdev1-Sep-09 2:47
dotnetcsharpdev1-Sep-09 2:47 
AnswerRe: client side validation for server control Pin
stancrm1-Sep-09 2:49
stancrm1-Sep-09 2:49 
QuestionWrong path. Pin
yuneyev1-Sep-09 2:33
yuneyev1-Sep-09 2:33 
AnswerRe: Wrong path. Pin
stancrm1-Sep-09 2:50
stancrm1-Sep-09 2:50 
AnswerRe: Wrong path. Pin
Luc Pattyn1-Sep-09 4:48
sitebuilderLuc Pattyn1-Sep-09 4:48 
AnswerRe: Wrong path. Pin
Tony Richards1-Sep-09 9:09
Tony Richards1-Sep-09 9:09 
QuestionHow to add Sort Icon to Gridview Header? Pin
Ganapatisb1-Sep-09 2:09
Ganapatisb1-Sep-09 2:09 
QuestionAuto hide view component Pin
anishkannan1-Sep-09 2:08
anishkannan1-Sep-09 2:08 

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.