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?
ed_dalianAsked:
Who is Participating?
 
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.

Bob
0
 
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");

Bob
0
 
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.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
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;

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

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.

Bob
0
 
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.
0
 
ed_dalianAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.