Hi everybody,
I'm trying DesktopAlert for the first time.
I'm close to reach my goal, but I'm experiencing a bad behavior, please could you help me finding the right way or even saying me definitively it will not work?I instantiated a DesktopAlert, then added a UltraDesktopAlertButton to DesktopAlertButtonsCollection:
Infragistics.Win.Misc.UltraDesktopAlert tip = new Infragistics.Win.Misc.UltraDesktopAlert();DesktopAlertButtonsCollection alertButtons = tip.AlertButtons;UltraDesktopAlertButton button = alertButtons.Add("My_Button");button.Appearance.Image = new Bitmap(16,16);button.ToolTipText = "never disabled button";
So far so good
Then I set following property:
button.Enabled = false;
I was expecting to see that button grayed-out with no interoperability, but I was so surprised when run the application and seen the button perfectively active.
What's wrong?
Thanks in advance
Gianni
Hristo,
I tried and it seems to solve, but a little strange behavior. Please in your sample project, in Form1 class code, subscrive event
ultraDesktopAlert1.AlertButtonClicked += new Infragistics.Win.Misc.AlertButtonClickedHandler(ultraDesktopAlert1_AlertButtonClicked);
with this sample code:
void ultraDesktopAlert1_AlertButtonClicked(object sender, Infragistics.Win.Misc.AlertButtonClickedEventArgs e) { MessageBox.Show("Hello world!);" }
Now if you execute the app and try to click on disable button nothing will happen. Correct !
But what if you try to double click the disabled button?
Hello,
You are right. But I have made some modifications and now I think that I achieve your goal on a very simply way. Please in MyCreation class, find AfterCreateChildElements method and replace the content of the If clauses with :
((AlertButtonUIElement)alertImage.Parent).Enabled = ((AlertButtonUIElement)alertImage.Parent).Button.Enabled;
Thank you.
Hello Hristo,
yes this way could be used to obtain my goal. Your sample is not enough to generate the behavior I desire, because still the button border get highlighted when mouse is over, but probably this will be solved by extending the creation filter you provided.However this way is intricate and, if not mistaken, do not really disable the control, just modifies its appearance to make it looks as disabled. This means that "Enabled" property has to be manually checked in any case, e.g. on alert button click event to avoid execution if it is disabled...
I am currently working on a different project, but as soon as I can (one or two months) I will come back to that project and I will try this solution.
Thank you very much
I have created a small sample where the disabled alert button has grey appearance. Please run the sample and hover the mouse over the button, in order to display the alert. You will see 2 buttons, one in grey (disabled) and the other normal one. I hope that this will resolve your issue.
Thank you for using Infragistics Components.