Hello,teamI've got a problem with the UltraButton style setting.What I need is shown in the first screenshot, which is with the round-angle and single color tiled.
But what I got is shown in the second screenshot, which has some kind gap between the setting color and the edge.Here is the code that the second one using(with winform standard button):
this.BackColor = Color.FromArgb(0, 153, 255); this.ForeColor = Color.FromArgb(255, 255, 255);
I didn't using the OSThemes, and with the third one(with UltraButton), it's right-angle:
appearance2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(o)))), ((int)(((byte)(153)))), ((int)(((byte)(255)))));appearance2.ThemedElementAlpha = Infragistics.Win.Alpha.Transparent;
How could I implement the Button style which is shown in the first screenshot?Thanks for your concern.
Hi Richard,
Thank you for posting in our forums.
The easiest way to create such button is to leave the UseOSThemes to its Default value. This will leave the button with round borders. In order to have the same colors and style like the one from the image you can use AppStylist. The IG.isl file already styles the button in such way.
I have attached a sample which demonstrates this suggestion.
Please let me know if you have any additional questions.
Hi Dimitar
Thanks for answering and the sample code.
I've did what you said above and I've set my button like this:
I didn't use the AppStylist, set UseOsThemes to Default, Appearance_BackColor to Color.Red and Appearance_ThemedElementAlpha to Transparent.
Which I got is like the image in screenshot one, with right-angle and Red color. If the Appearance_ThemedElementAlpha is not setting to Transparent, the button will be with round borders and no backColor, which is shown in screenshot two.
Further more, I need about four types button in my application. And each type has one different color.
1.If I'm not using the IG.isl, how could I get the button with round borders and desired backColor?
2.If I use the IG.isl, how could I change the color of the button?Is there any properties that I could set when I need to change the color?
Could you please help me with that? Thanks for your concern.
Thank you for the reply.
The round border of the button and its colors are part of the theme provided by the OS. If you want to turn it off that will allow you to set the colors, but the button will also lose all other styling properties from the theming along with its round border. So that is why I suggested using AppStylist, which allows you to have custom colors along with round buttons. If you have multiple buttons that you need to style differently, you could create several isl files for the different button styles. To specify which button should use which style, you can use the override of the Load method of the StyleManager that takes a StyleLibrary name and set the StyleLibraryName of your controls. Alternative approach is to define several style sets in one isl file. This approach is described here:
http://es.infragistics.com/community/forums/t/69399.aspx
If you don’t want to use the AppStylist you can use ShapeImage property to define the round shape:
http://help.infragistics.com/Doc/WinForms/2014.2/CLR4.0/?page=Infragistics4.Win.Misc.v14.2~Infragistics.Win.Misc.UltraButton~ShapeImage.html
I have attached a sample which demonstrates the approach with the several isl files.
Hi, Dimitar
Thanks for your help. And it had solved my problem.
Thanks again.