Two questions about control

In windows application:
1. how to set a button, when I click it, it drops down and don't pop up, when I click it again it pops op?
2. how to set a mouse cursor to be a picture or a icon that I want, when it move over a control?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
1) If you want a checked button, then use a CheckBox instead of a button.  It will stay down until checked again.

2) Set button cursor to an image:

   this.button1.Cursor  = new Cursor(@"c:\windows\cursors\pen_i.cur");

ed_dalianAuthor Commented:
for 1) I want to check the button like the pan in the paint soft , click the pen I could paint on a picture, click again it wont.
Bob LearnedCommented:
These are the settings that you need for a CheckBox button:

  this.checkBox1.Appearance = System.Windows.Forms.Appearance.Button;
  this.checkBox1.Checked = true;
  this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
  this.checkBox1.Image = ((System.Drawing.Image)(resources.GetObject("checkBox1.Image")));
  this.checkBox1.Location = new System.Drawing.Point(172, 48);
  this.checkBox1.Name = "checkBox1";
  this.checkBox1.Size = new System.Drawing.Size(64, 32);
  this.checkBox1.TabIndex = 0;

Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

ed_dalianAuthor Commented:
I don't need a checkBox, I need a buttom been pushed
Bob LearnedCommented:

With these settings, you will get a control that looks just like a button, but it will stay pushed as long as Checked = true.  When you don't want it to be pushed any more set Checked = false.

ed_dalianAuthor Commented:
Hi Bob:
    I want to make a pen button to draw on a picture, I want a button to like windows paint do.
Bob LearnedCommented:
Right, so change the CheckBox.Appearance to Button and set the Image to a pen, et voila you have a button like Paint.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ed_dalianAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.