Click here to Skip to main content
15,886,012 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: Auto hide view component Pin
stancrm1-Sep-09 2:28
stancrm1-Sep-09 2:28 
GeneralRe: Auto hide view component Pin
anishkannan1-Sep-09 4:25
anishkannan1-Sep-09 4:25 
QuestionWindows Form Freeze Pin
Shyamraja1-Sep-09 1:11
Shyamraja1-Sep-09 1:11 
QuestionLogin failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Pin
Rajesh Koriya1-Sep-09 0:38
Rajesh Koriya1-Sep-09 0:38 
AnswerRe: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Pin
Aman Bhullar1-Sep-09 0:42
Aman Bhullar1-Sep-09 0:42 
QuestionHow to Bind C1TDBDrop Down with C1Database Grid Pin
Manish791-Sep-09 0:30
Manish791-Sep-09 0:30 
AnswerRe: How to Bind C1TDBDrop Down with C1Database Grid Pin
Mycroft Holmes1-Sep-09 1:44
professionalMycroft Holmes1-Sep-09 1:44 

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.