| You must Sign In to use this message board. |
|
|
 |
|
 |
IButtonControl allows a control to act like a button on a form.
public interface IButtonControl
Classes that Implement IButtonControl Class Description Button Represents a Windows button control. LinkLabel Represents a Windows label control that can display hyperlinks.
Remarks An example of where this interface might be implemented is default and cancel button processing. Default buttons are notified when an unprocessed ENTER key is entered for a form, just like a dialog box would be closed. Similarly, cancel buttons are notified whenever an unprocessed ESC key is entered on a form, much like a dialog box would be dismissed. Notes to Implementers: Implement this interface in classes that act as button controls. The members of this interface will provide basic button functionality, such as providing a DialogResult to the parent form or the ability to perform a Click event, or acting as the default button of a form.
Example The following example inherits from the ButtonBase class and implements the IButtonControl interface. Implementation is added to the DialogResult property and the NotifyDefault and PerformClick methods.
using System; using System.Windows.Forms; using System.Drawing;
public class MyButton : ButtonBase, IButtonControl { private DialogResult myDialogResult;
public MyButton() { // Make the button White and a Popup style // so it can be distinguished on the form. this.FlatStyle = FlatStyle.Popup; this.BackColor = Color.White; } // Add implementation to the IButtonControl.DialogResult property. public DialogResult DialogResult { get { return this.myDialogResult; }
set { if(Enum.IsDefined(typeof(DialogResult), value)) { this.myDialogResult = value; } } }
// Add implementation to the IButtonControl.NotifyDefault method. public void NotifyDefault(bool value) { if(this.IsDefault != value) { this.IsDefault = value; } }
// Add implementation to the IButtonControl.PerformClick method. public void PerformClick() { if(this.CanSelect) { this.OnClick(EventArgs.Empty); } } }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Really it is a nice control. I regularly check CP, and I am surprised how did I skip it earlier.
Anyways, keep it up with the good work! 
|
| Sign In·View Thread·PermaLink | 3.00/5 |
|
|
|
 |
|
 |
Tanks ....After this comments I tink I increase my work on CP and first of all in the next day I will update this work and I will publish a new one.
Tanks thousands,and goog work!!
==============================
http://zeppaman.altervista.org
==============================
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
 | Nice  NinjaCross | 0:51 10 May '06 |
|
 |
A very nice control, thanks for sharing it. Unfortunatley its unique nature makes it not so usefull because I really don't know where to apply it. This could be a good occasion for you to create some more components with the same design concepts and build up a complete suite
-- NinjaCross www.ninjacross.com
|
| Sign In·View Thread·PermaLink | 5.00/5 |
|
|
|
 |
|
 |
First of all tanks for your positives comments. I have yet written other components with the same style. In the next days I will update this article inserting all the yet developed components (label,panels,ecc...).I will contact you after that.
T@nks;P
==============================
http://zeppaman.altervista.org
==============================
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
 | tyu  pccai | 2:12 24 Nov '05 |
|
|
 |
|
 |
 I like this component but I can't use it because i haven't any other component like this.So I ask to the author ,or to someelse:
There are components that look like this? Were I can find other component with this look?
Tanks
Mr Chicken
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
This control probably isn't going to work unless you happen to be making an app using a similar style. I'm guessing the author made this for such an app and decided to share it.
The fact is, if your app doesn't fit those parameters, it still might be useful. You can look at the source if the button does something you want to learn how to do, or you can modify the source to make the button fit the style of your app.
|
| Sign In·View Thread·PermaLink | 5.00/5 |
|
|
|
 |
|
|