Click here to Skip to main content
15,893,486 members
Home / Discussions / C#
   

C#

 
QuestionHow to get the "Company Name" of local user? Pin
Affan Toor20-Jun-07 3:50
Affan Toor20-Jun-07 3:50 
AnswerRe: How to get the "Company Name" of local user? Pin
Yitzchok Dev20-Jun-07 19:46
Yitzchok Dev20-Jun-07 19:46 
GeneralRe: How to get the "Company Name" of local user? Pin
Affan Toor21-Jun-07 0:28
Affan Toor21-Jun-07 0:28 
GeneralRe: How to get the "Company Name" of local user? Pin
Yitzchok Dev21-Jun-07 8:59
Yitzchok Dev21-Jun-07 8:59 
QuestionPoint to Inch Pin
priyank_ldce20-Jun-07 3:41
priyank_ldce20-Jun-07 3:41 
AnswerRe: Point to Inch Pin
Manas Bhardwaj20-Jun-07 4:00
professionalManas Bhardwaj20-Jun-07 4:00 
GeneralRe: Point to Inch Pin
priyank_ldce20-Jun-07 5:56
priyank_ldce20-Jun-07 5:56 
QuestionSetting focus to the beginning of a MaskedTextBox Pin
NYTSX20-Jun-07 3:40
NYTSX20-Jun-07 3:40 
Hi,

I know this should be a simple task, but for some odd reason I can't get this to work correct.

I have a MaskedTextBox which is used to take a 5 digit number. My problem is since I made the box a little bigger than the size it would be with 5 digits in it, I want to set the focus to the beginning of the box if the user hasn't entered anything into it yet and clicks on the box to ensure they put in 5 digits.

I set up the event "Enter" with the following code:
if(maskedTB.Text.Length == 0)<br />
{     <br />
     maskedTB.Focus();<br />
     maskedTB.Select(0,0);<br />
     maskedTB.Select();<br />
}


I tried each one of these individually and every combination of the three.

They all just set the focus to be wherever the user selected. So if they select on the area where the 5th digit resides it only allows them to enter 1 number and forces them to hit backspace until they get to the beginning.

Thanks.
AnswerRe: Setting focus to the beginning of a MaskedTextBox Pin
Luc Pattyn20-Jun-07 4:05
sitebuilderLuc Pattyn20-Jun-07 4:05 
GeneralRe: Setting focus to the beginning of a MaskedTextBox Pin
NYTSX20-Jun-07 4:14
NYTSX20-Jun-07 4:14 
AnswerRe: Setting focus to the beginning of a MaskedTextBox Pin
Stu Richardson20-Jun-07 4:25
Stu Richardson20-Jun-07 4:25 
QuestionListbox items to array Pin
neer120-Jun-07 3:16
neer120-Jun-07 3:16 
AnswerRe: Listbox items to array Pin
Chintan.Desai20-Jun-07 3:37
Chintan.Desai20-Jun-07 3:37 
GeneralRe: Listbox items to array Pin
Stu Richardson20-Jun-07 3:40
Stu Richardson20-Jun-07 3:40 
AnswerRe: change de currentrow of datagridview Pin
Chintan.Desai20-Jun-07 3:45
Chintan.Desai20-Jun-07 3:45 
QuestionExporting Data to Multiple Excel Sheets in C# Windows Application Pin
meeram39520-Jun-07 2:10
meeram39520-Jun-07 2:10 
AnswerRe: Exporting Data to Multiple Excel Sheets in C# Windows Application Pin
Sandeep Akhare20-Jun-07 3:09
Sandeep Akhare20-Jun-07 3:09 
Questionhow can i make a full row select in a datagrid Pin
-spy-20-Jun-07 1:52
-spy-20-Jun-07 1:52 
AnswerRe: how can i make a full row select in a datagrid Pin
Not Active20-Jun-07 2:24
mentorNot Active20-Jun-07 2:24 
AnswerRe: how can i make a full row select in a datagrid Pin
Stu Richardson20-Jun-07 3:35
Stu Richardson20-Jun-07 3:35 
QuestionProgramming processes in C# - concurrency [modified] Pin
Theghost20-Jun-07 1:22
Theghost20-Jun-07 1:22 
AnswerRe: Programming processes in C# - concurrency Pin
J4amieC20-Jun-07 3:01
J4amieC20-Jun-07 3:01 
QuestionKey Press event of textbox Pin
Sapan Roy20-Jun-07 1:10
Sapan Roy20-Jun-07 1:10 
AnswerRe: Key Press event of textbox Pin
Martin#20-Jun-07 1:16
Martin#20-Jun-07 1:16 
QuestionString Concatenation Issue Pin
Brendan Vogt20-Jun-07 0:44
Brendan Vogt20-Jun-07 0: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.