Click here to Skip to main content
16,010,523 members
Home / Discussions / C#
   

C#

 
QuestionTurning off the insertion point. Pin
Jamestown4828-Dec-06 12:11
Jamestown4828-Dec-06 12:11 
AnswerRe: Turning off the insertion point. Pin
Judah Gabriel Himango28-Dec-06 12:26
sponsorJudah Gabriel Himango28-Dec-06 12:26 
AnswerRe: Turning off the insertion point. Pin
PIEBALDconsult28-Dec-06 12:56
mvePIEBALDconsult28-Dec-06 12:56 
GeneralRe: Turning off the insertion point. Pin
Jamestown4828-Dec-06 15:09
Jamestown4828-Dec-06 15:09 
GeneralRe: Turning off the insertion point. Pin
Luc Pattyn28-Dec-06 15:32
sitebuilderLuc Pattyn28-Dec-06 15:32 
GeneralRe: Turning off the insertion point. Pin
Jamestown4828-Dec-06 16:22
Jamestown4828-Dec-06 16:22 
GeneralRe: Turning off the insertion point. Pin
PIEBALDconsult29-Dec-06 4:22
mvePIEBALDconsult29-Dec-06 4:22 
GeneralRe: Turning off the insertion point. Pin
dbetting29-Dec-06 13:59
dbetting29-Dec-06 13:59 
I understand you would like to have TextBox.Enabled=true but if you are trying to control the user's actions, you need to make it very clear to them what is expected. Upon loading or clearing the form, set the data entry controls read-only. Then upon clicking the [Add], [Edit] or whatever the button is called, the first thing you do is enable your text boxes, radiobuttons and any other controls the user is to access for data entry.

If you just hide the cursor, the user clicks on the TextBox and says "What's wrong? The cursor disappeared!" If it is disabled, it is pretty clear the only option they have is to tell the program what they want to do such as [Add], [Edit], etc.

I usually have two core methods in most of my forms: Clear() and SetReadOnly(bool value). Upon loading the form or saving a record Clear() is called which sets all the default values for the fields. One of the last lines in Clear() is the call SetReadOnly(true); to disable all the controls. The only option the user has at this point is to click [New] or [Cancel]. If they click [New], I call SetReadOnly(false); and set the focus on the first field I want them to fill in (i.e. TextBox.SetFocus();).

Just a suggestion.
GeneralRe: Turning off the insertion point. Pin
jk chan28-Dec-06 16:52
jk chan28-Dec-06 16:52 
GeneralRe: Turning off the insertion point. Pin
Jamestown4828-Dec-06 16:59
Jamestown4828-Dec-06 16:59 
GeneralRe: Turning off the insertion point. Pin
jk chan28-Dec-06 17:19
jk chan28-Dec-06 17:19 
GeneralRe: Turning off the insertion point. Pin
jk chan28-Dec-06 17:33
jk chan28-Dec-06 17:33 
QuestionString to URL Pin
dsl/fahk28-Dec-06 11:48
dsl/fahk28-Dec-06 11:48 
AnswerRe: String to URL Pin
Judah Gabriel Himango28-Dec-06 12:32
sponsorJudah Gabriel Himango28-Dec-06 12:32 
GeneralRe: String to URL Pin
dsl/fahk28-Dec-06 12:39
dsl/fahk28-Dec-06 12:39 
GeneralRe: String to URL Pin
jk chan28-Dec-06 17:12
jk chan28-Dec-06 17:12 
QuestionIndexer vs function Pin
axos8828-Dec-06 10:22
axos8828-Dec-06 10:22 
AnswerRe: Indexer vs function [modified] Pin
Luc Pattyn28-Dec-06 10:44
sitebuilderLuc Pattyn28-Dec-06 10:44 
Questionhi, c# forms Pin
sopho2428-Dec-06 10:07
sopho2428-Dec-06 10:07 
AnswerRe: hi, c# forms Pin
karam chandrabose28-Dec-06 15:33
karam chandrabose28-Dec-06 15:33 
AnswerRe: hi, c# forms Pin
Flysocket28-Dec-06 20:19
Flysocket28-Dec-06 20:19 
GeneralRe: hi, c# forms Pin
sopho2429-Dec-06 12:56
sopho2429-Dec-06 12:56 
QuestionHide form at startup Pin
Mike Hankey28-Dec-06 9:54
mveMike Hankey28-Dec-06 9:54 
AnswerRe: Hide form at startup Pin
sopho2428-Dec-06 10:25
sopho2428-Dec-06 10:25 
GeneralRe: Hide form at startup Pin
Mike Hankey28-Dec-06 10:39
mveMike Hankey28-Dec-06 10:39 

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.