ed_dalian
asked on
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?
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?
ASKER
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.
These are the settings that you need for a CheckBox button:
this.checkBox1.Appearance = System.Windows.Forms.Appea rance.Butt on;
this.checkBox1.Checked = true;
this.checkBox1.CheckState = System.Windows.Forms.Check State.Chec ked;
this.checkBox1.Image = ((System.Drawing.Image)(re sources.Ge tObject("c heckBox1.I mage")));
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
this.checkBox1.Appearance = System.Windows.Forms.Appea
this.checkBox1.Checked = true;
this.checkBox1.CheckState = System.Windows.Forms.Check
this.checkBox1.Image = ((System.Drawing.Image)(re
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
ASKER
I don't need a checkBox, I need a buttom been pushed
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
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
ASKER
Hi Bob:
I want to make a pen button to draw on a picture, I want a button to like windows paint do.
I want to make a pen button to draw on a picture, I want a button to like windows paint do.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
2) Set button cursor to an image:
this.button1.Cursor = new Cursor(@"c:\windows\cursor
Bob