Click here to Skip to main content
15,909,652 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: dot net compilation Pin
Dave Kreskowiak11-Jun-07 2:49
mveDave Kreskowiak11-Jun-07 2:49 
AnswerRe: dot net compilation Pin
Abisodun11-Jun-07 8:21
Abisodun11-Jun-07 8:21 
GeneralRe: dot net compilation Pin
Luc Pattyn12-Jun-07 5:45
sitebuilderLuc Pattyn12-Jun-07 5:45 
GeneralRe: dot net compilation Pin
Abisodun12-Jun-07 13:31
Abisodun12-Jun-07 13:31 
QuestionDefault class access modifier Pin
Brendan Vogt10-Jun-07 20:04
Brendan Vogt10-Jun-07 20:04 
AnswerRe: Default class access modifier Pin
Sathesh Sakthivel10-Jun-07 20:12
Sathesh Sakthivel10-Jun-07 20:12 
AnswerRe: Default class access modifier Pin
vijayvisu10-Jun-07 21:28
vijayvisu10-Jun-07 21:28 
GeneralRe: Default class access modifier Pin
Sathesh Sakthivel10-Jun-07 23:07
Sathesh Sakthivel10-Jun-07 23:07 
GeneralRe: Default class access modifier Pin
DavidNohejl11-Jun-07 22:12
DavidNohejl11-Jun-07 22:12 
AnswerRe: Default class access modifier Pin
originSH10-Jun-07 23:53
originSH10-Jun-07 23:53 
AnswerRe: Default class access modifier Pin
PIEBALDconsult18-Jun-07 4:43
mvePIEBALDconsult18-Jun-07 4:43 
QuestionURL Rewriting Pin
Brendan Vogt10-Jun-07 19:50
Brendan Vogt10-Jun-07 19:50 
AnswerRe: URL Rewriting Pin
Sathesh Sakthivel10-Jun-07 19:57
Sathesh Sakthivel10-Jun-07 19:57 
AnswerRe: URL Rewriting Pin
Vasudevan Deepak Kumar15-Jun-07 3:15
Vasudevan Deepak Kumar15-Jun-07 3:15 
QuestionVS2005 Help Problem Pin
Mike Hankey10-Jun-07 16:49
mveMike Hankey10-Jun-07 16:49 
AnswerRe: VS2005 Help Problem Pin
Sathesh Sakthivel10-Jun-07 20:00
Sathesh Sakthivel10-Jun-07 20:00 
GeneralRe: VS2005 Help Problem Pin
Mike Hankey11-Jun-07 1:12
mveMike Hankey11-Jun-07 1:12 
GeneralRe: VS2005 Help Problem Pin
Sathesh Sakthivel11-Jun-07 2:38
Sathesh Sakthivel11-Jun-07 2:38 
QuestionValidation Pin
imran_Shaikh10-Jun-07 1:54
imran_Shaikh10-Jun-07 1:54 
AnswerRe: Validation Pin
Christian Graus10-Jun-07 13:49
protectorChristian Graus10-Jun-07 13:49 
QuestionMaskedTextBox + KeyEventArgs.SuppressKeyPress = bug? Pin
alex3_148-Jun-07 6:37
alex3_148-Jun-07 6:37 
My MaskedTextBox seems to have a bug in combination with the following function which gets called within the KeyDown event for all my TextBoxes:

<br />
private void dataEntryBehaviour(object sender, KeyEventArgs e)<br />
		{<br />
			if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Down)<br />
			{<br />
//				e.KeyCode = Keys.Down;	//to avoid the 1st input character disappearing bug<br />
										//NOT ALLOWED - READ ONLY!<br />
<br />
				//SuppressKeyPress is used to keep ENTER from being heard<br />
				e.SuppressKeyPress = true;	//this also sets e.Handled to true<br />
				this.SelectNextControl((Control)sender, true, true, true, true);<br />
			}<br />
			else if (e.KeyCode == Keys.Up)<br />
			{<br />
				e.SuppressKeyPress = true;	//this also sets e.Handled to true<br />
				this.SelectNextControl((Control)sender, false, true, true, true);<br />
			}<br />
		}<br />


The error is the following: After the user finishes entering the data, they can click a button to add the data into the database. The form then calls ResetText() on all the TextBoxes and the data entry begins anew. And here is where weird things happen: The first character typed into the MaskedTextBox disappears immediately after the second character input is typed (leaving a space behind). Also weird: If I don't set MaskedTextBox.SelectionStart = 1, the first character typed appears before what the Mask should allow ("(000) 000-0000").

Note that even if I set MaskedTextBox.SelectionStart = 1, which will display the first character to appear after the "(" literal, it'll still disappear after the second character is typed.

<br />
Attempting to type "3056667777" results:<br />
<br />
Without setting MaskedTextBox.SelectionStart = 1, "(056) 667-777_"<br />
<br />
With setting MaskedTextBox.SelectionStart = 1, "(_05) 666-7777"<br />
<br />
So, essentially, to get the results I want I'd have to not set MaskedTextBox.SelectionStart = 1, and type "33056667777".<br />


Now, this error only occurs on in my MaskedTextBoxes (not my vanilla TextBoxes) and only when ENTER is pressed to navigate away from that particular control. Also, if I use KeyEventArgs.Handled instead KeyEventArgs.SuppressKeyPress - the problem disappears. Unfortunately, I then get a "Windows XP Ding" every time I hit ENTER.

What am I doing wrong or is this just a bug with MS' new control?

Alex

QuestionCustom DataGridViewComboBoxColumn Pin
MaverickDQ8-Jun-07 5:01
MaverickDQ8-Jun-07 5:01 
AnswerRe: Custom DataGridViewComboBoxColumn Pin
Robert Rohde8-Jun-07 21:48
Robert Rohde8-Jun-07 21:48 
GeneralRe: Custom DataGridViewComboBoxColumn Pin
MaverickDQ8-Jun-07 22:44
MaverickDQ8-Jun-07 22:44 
QuestionWorkflowFoundation: How to (un)persist types from different assembly versions Pin
Lord Skeletor8-Jun-07 2:31
Lord Skeletor8-Jun-07 2:31 

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.