Click here to Skip to main content
16,004,927 members
Home / Discussions / C#
   

C#

 
AnswerRe: Test for Scroll Lock State Pin
Curtis Schlak.10-Jan-06 15:57
Curtis Schlak.10-Jan-06 15:57 
GeneralRe: Test for Scroll Lock State Pin
dmbrider11-Jan-06 2:56
dmbrider11-Jan-06 2:56 
Questionmime handling with webbrowser control Pin
abnopanda10-Jan-06 13:24
abnopanda10-Jan-06 13:24 
AnswerRe: mime handling with webbrowser control Pin
leppie10-Jan-06 18:51
leppie10-Jan-06 18:51 
AnswerRe: mime handling with webbrowser control Pin
mitooki12-Jan-06 3:51
mitooki12-Jan-06 3:51 
GeneralRe: mime handling with webbrowser control Pin
abnopanda12-Jan-06 8:17
abnopanda12-Jan-06 8:17 
GeneralRe: mime handling with webbrowser control Pin
mitooki12-Jan-06 23:54
mitooki12-Jan-06 23:54 
QuestionReseting the text in a control. Pin
DELETEUSER10-Jan-06 11:22
DELETEUSER10-Jan-06 11:22 
In a windows form I have a textbox and a button. Initially the text box contains "Enter ID" as the default text. I enter some ID and click the button which saves the ID to an XML. After that, the text in the textbox should revert back to "Enter ID" as before.

Right now my code is a below...

// Windows Form Designer generated code
// First time I intialize the dafault text
this.txtbox1.Text = "Enter ID";

// Button_click
private void button1_Click(object sender, System.EventArgs e)
{
//Write To File and reset all textboxes on the form for default text
SaveToXML();
ResetAllTextBoxes();
}


// Reset all text boxes on the window
private void ResetAllTextBoxes()
{
this.textbox1.Text = "Enter ID";

....
....

this.textbox10.Text = "There has to be some another way"

}

I'm not satisfied with this implementation because if I have 10 textboxes I need to have 20 lines of code doing the same. 10 lines in the Windows Form Designer generated code and 10 in ResetAllTextBoxes() method.

I tried the textbox1.ResetText() method but instead of reseting it to default text such as "Enter ID" it resets to blank.

Is there a better solution.

Thanks

----------
Venus Patel
http://patelsinc.blogspot.com/

A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.


-- modified at 17:25 Tuesday 10th January, 2006
AnswerRe: Reseting the text in a control. Pin
Christian Graus10-Jan-06 12:10
protectorChristian Graus10-Jan-06 12:10 
AnswerRe: Reseting the text in a control. Pin
Guffa10-Jan-06 13:59
Guffa10-Jan-06 13:59 
QuestionResponding to a click on a Shockwave object. Pin
jbradshaw10-Jan-06 10:35
jbradshaw10-Jan-06 10:35 
AnswerRe: Responding to a click on a Shockwave object. Pin
mitooki11-Jan-06 1:09
mitooki11-Jan-06 1:09 
QuestionOutOfMemory loading massive XML file Pin
Martin2310-Jan-06 10:07
Martin2310-Jan-06 10:07 
AnswerRe: OutOfMemory loading massive XML file Pin
Guffa10-Jan-06 10:38
Guffa10-Jan-06 10:38 
GeneralRe: OutOfMemory loading massive XML file Pin
Martin2310-Jan-06 11:30
Martin2310-Jan-06 11:30 
AnswerRe: OutOfMemory loading massive XML file Pin
Christian Graus10-Jan-06 12:12
protectorChristian Graus10-Jan-06 12:12 
GeneralRe: OutOfMemory loading massive XML file Pin
Matt Gerrans10-Jan-06 16:03
Matt Gerrans10-Jan-06 16:03 
GeneralRe: OutOfMemory loading massive XML file Pin
Martin2311-Jan-06 4:43
Martin2311-Jan-06 4:43 
GeneralRe: OutOfMemory loading massive XML file Pin
Matt Gerrans11-Jan-06 7:27
Matt Gerrans11-Jan-06 7:27 
QuestionStupid question of the day Pin
Jamie Nordmeyer10-Jan-06 10:03
Jamie Nordmeyer10-Jan-06 10:03 
AnswerRe: Stupid question of the day Pin
leppie10-Jan-06 18:42
leppie10-Jan-06 18:42 
GeneralRe: Stupid question of the day Pin
Jamie Nordmeyer11-Jan-06 4:07
Jamie Nordmeyer11-Jan-06 4:07 
QuestionXML Serialization Pointer Fix uping Pin
asdf98910-Jan-06 9:32
asdf98910-Jan-06 9:32 
AnswerRe: XML Serialization Pointer Fix uping Pin
Dave Kreskowiak10-Jan-06 15:41
mveDave Kreskowiak10-Jan-06 15:41 
AnswerRe: XML Serialization Pointer Fix uping Pin
Judah Gabriel Himango10-Jan-06 16:05
sponsorJudah Gabriel Himango10-Jan-06 16:05 

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.