English 中文(简体)
缩略语 小组
原标题:C# Simple GUI Panel

我先陷入一个简单的问题。 并且不能删除。

我已将小组改为静态公众,以便在整个网页上查阅小组。 并且当《全球倡议》发生变化时,它会把静态公众转嫁给公众。 给我一个错误。 您可以在此接触公众。

因此,我必须每当改变一个全球倡议的轨道来管理该方案时就固定下来。

请协助我。

I know this is a rubbish question. I am curious to know that what is happening at backhand.

我正在使用2011年视觉演播室。 Developmenter preview.

问题回答

我假定你正在使用WinForms。

如果不改变微软视力演播室生成的自动生成的代码,那么在你改变某种情况时,这只会是虚构的。 而是在后面的代码中使用static

例如,在点击时会改变一个变量。

public static int MyGlobalVariable
private void button1_Clicked(object sender, EventArgs e)
{
    MyGlobalVariable = 4;
}

更早或更晚使用公开静态,也认为这种设计完全不同,会给你造成许多头痛。 通常较早。

我不敢正确理解你的问题(你所说的话是“何时改变了全球倡议”?)但或许这是你回顾的:

public partial class Form1 : Form
{
    public static Panel panelS = new Panel();

    public Form1()
    {
        InitializeComponent();
    }
}

而且:

public partial class Form2 : Form
{
    public Form2()
    {
        InitializeComponent();
        Form1.panelS.Location = new Point(100, 100);
    }
}




相关问题
Bring window to foreground after Mutex fails

I was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. E.g.: Application X is running ...

How to start WinForm app minimized to tray?

I ve successfully created an app that minimizes to the tray using a NotifyIcon. When the form is manually closed it is successfully hidden from the desktop, taskbar, and alt-tab. The problem occurs ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

Handle DataTable.DataRow cell change event

I have a DataTable that has several DataColumns and DataRow. Now i would like to handle an event when cell of this DataRow is changed. How to do this in c#?

Apparent Memory Leak in DataGridView

How do you force a DataGridView to release its reference to a bound DataSet? We have a rather large dataset being displayed in a DataGridView and noticed that resources were not being freed after the ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

WPF-XAML window in Winforms Application

I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application. Could you explain me how this is done.

热门标签