3 Replies - 355 Views - Last Post: 28 April 2010 - 08:26 PM Rate Topic: -----

#1 charliex2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 23-October 09

Trying to clear text on mouse clicked

Posted 28 April 2010 - 07:22 PM

I am trying to clear the text in a textBox when the mouse is clicked in it. Have tried a few different ways I am just missing something simple this is the way I was trying to do it.
 private void assetIDTextBox_TextChanged(object sender, EventArgs e)
        {
            primaryUser.setAssetID(assetIDTextBox.Text);
        }


private void assetIDTextBox_MouseClick(object sender, EventArgs e)
        {
            assetIDTextBox.Clear; 
        }




Also I am trying to do this for the password that will be entered also, but the password is protected so all it does is show **** instead of "Please Enter Password. Any Ideas?

This post has been edited by charliex2: 28 April 2010 - 07:24 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Trying to clear text on mouse clicked

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Trying to clear text on mouse clicked

Posted 28 April 2010 - 07:27 PM

You need to use the MouseDown Event
Was This Post Helpful? 0
  • +
  • -

#3 charliex2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 23-October 09

Re: Trying to clear text on mouse clicked

Posted 28 April 2010 - 07:55 PM

View PostPsychoCoder, on 28 April 2010 - 06:27 PM, said:

You need to use the MouseDown Event



It keeps giving me an error that says Only assignment, call, increment, decrement, and new object expressions can be used as a statement.... I am just not doing it right.... bad thing is I have done this before and just cant remember how..
Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Trying to clear text on mouse clicked

Posted 28 April 2010 - 08:26 PM

Now you need to show us how you're attempting this
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1