Click here to Skip to main content
15,888,065 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I have used a DevExpress.XtraEditors.panelcontrol in my winfrom application and now i want to change the color of it's border color by writing the following code in button1_Click event handler :

panel1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
panel1.Appearance.BorderColor = System.Drawing.Color.Red;

But nothing happen.
Please tell me what is my mistake?
Posted
Updated 6-Jul-13 0:14am
v3

you should use one of non-skin styles to be able to provide the border color for Panel. That is, set the control's LookAndFeel.Style property to Flat, UltraFlat or Style3D.
then write following code to change color

C#
panelControl1.Appearance.BorderColor =  Color.Red;
 
Share this answer
 
Comments
M_Mogharrabi 6-Jul-13 6:14am    
I tried your solution but nothing changed.
Sadique KT 6-Jul-13 6:17am    
it works for me.. have u changed panel looknfeel property?
Sadique KT 6-Jul-13 6:20am    
hope u have done this too..
panelControl1.LookAndFeel.UseDefaultLookAndFeel = false;
M_Mogharrabi 7-Jul-13 3:43am    
Thanks Sadique KT,Now it works for me too.
Try this...:)
C#
panelControlContainer.Appearance.BorderColor = System.Drawing.Color.Red;
 
Share this answer
 
v2
Comments
M_Mogharrabi 6-Jul-13 6:15am    
Thanks but my control is panelcontrol not panelcontrolcontainer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900