0

I have a panel in my Form like this:

enter image description here

and a Panel_BackColor in project's Settings.setting file:

enter image description here

I can change panel back color in the Form constructor:

public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
            panel1.BackColor = UI_Settings.Default.Panel_BackColor;
        }
    } 

All things work at runtime:

enter image description here

But nothing change at Design Time. How can I apply these settings at Design mode too?

Ayub
  • 2,345
  • 27
  • 29

3 Answers3

0

I got your question, I try to handle with it when I use MetroFramework. Some changes just shown in runtime because it use another drawing technic with xml or .netframework when you use runtime code. So, I think you can't see changes in design time.

Mert Akkanat
  • 111
  • 7
-1

Next time try to explain a little more in details or maybe add some code or images to make us understand better.

In C# you have the property:

//Namespace: System.ComponentModel

//Gets a value that indicates whether the Component is currently in design mode.
//true if the Component is in design mode; otherwise, false.
protected bool DesignMode { get; } 
Silviu
  • 56
  • 7
-1

I asked "not edited version" of this question on MSDN forum and got an answer within an hour.

Questions like Convert int to string? is a good questions but mine is not! I think stackoverflow should keep a watch on it's editors and policy.

The answer:

Select your control in Form Designer (for example a button), go to Properties, (ApplicationSettings),(PropertyBinding), then bind BackColor or other property to Button_BackColor or other settings. Afterward by changing settings in Settings.settings file, all binded controls would be affected.

Ayub
  • 2,345
  • 27
  • 29