本文整理汇总了C#中FormWindowState类的典型用法代码示例。如果您正苦于以下问题:C# FormWindowState类的具体用法?C# FormWindowState怎么用?C# FormWindowState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FormWindowState类属于命名空间,在下文中一共展示了FormWindowState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMove
private void OnMove(object sender, System.EventArgs e)
{
if (form.WindowState == FormWindowState.Normal)
dimensions.Location = form.Location;
windowState = form.WindowState;
}
示例2: LoadApplicationSettings
private const int SettingsLocation = 0; // 0 - registry, 1 - ini-file
#endregion Fields
#region Methods
public static void LoadApplicationSettings()
{
RegistryKey regKey = Registry.CurrentUser.OpenSubKey(SettingsAndConstants.RegistryLocation);
LastProjectFileName = HiddenObjectStudio.Core.Tools.GetParameterFromReg(regKey, "LastProjectFile", string.Empty);
DisplaySpriteActiveArea = HiddenObjectStudio.Core.Tools.GetParameterFromReg(regKey, "DisplaySpriteActiveArea", true);
LastProjectBrowsePath = HiddenObjectStudio.Core.Tools.GetParameterFromReg(regKey, "LastProjectBrowsePath", string.Empty);
LastSpriteBrowsePath = HiddenObjectStudio.Core.Tools.GetParameterFromReg(regKey, "LastSpriteBrowsePath", string.Empty);
LastBackgroundBrowsePath = HiddenObjectStudio.Core.Tools.GetParameterFromReg(regKey, "LastBackgroundBrowsePath", string.Empty);
if (HiddenObjectStudio.Core.Tools.GetParameterFromReg(regKey, "Maximized", false))
{
MainFormState = FormWindowState.Maximized;
}
else
{
MainFormPosition.Location = new Point(
HiddenObjectStudio.Core.Tools.GetParameterFromReg(regKey, "WindowLeft", 0),
HiddenObjectStudio.Core.Tools.GetParameterFromReg(regKey, "WindowTop", 0)
);
MainFormPosition.Width = HiddenObjectStudio.Core.Tools.GetParameterFromReg(regKey, "WindowWidth", 0);
MainFormPosition.Height = HiddenObjectStudio.Core.Tools.GetParameterFromReg(regKey, "WindowHeight", 0);
MainFormState = FormWindowState.Normal;
}
LoadPreferences();
if (regKey != null) regKey.Close();
}
示例3: return
public static FormWindowState «агрузить(string путь, string секци¤, string им¤, FormWindowState значениеѕо”молчанию)
{
int число = «агрузить(путь, секци¤, им¤, (int)значениеѕо”молчанию);
if (число < 0 || число > 2)
return значениеѕо”молчанию;
return (FormWindowState)число;
}
示例4: SaveFormState
private void SaveFormState(Form a_form)
{
if (a_form.WindowState == FormWindowState.Normal)
m_bounds = a_form.Bounds;
if (a_form.WindowState != FormWindowState.Minimized)
m_window_state = a_form.WindowState;
}
示例5: load
public void load()
{
using (RegistryKey r = Registry.CurrentUser.OpenSubKey(@"Software\" + CompanyId() + @"\" + AppId() + @"\Window State\" + form.Name))
{
if (r != null)
{
try
{
string _location = (string)r.GetValue("location"), _size = (string)r.GetValue("size");
state = (FormWindowState)r.GetValue("state");
location = (Point)TypeDescriptor.GetConverter(typeof(Point)).ConvertFromInvariantString(_location);
size = (Size)TypeDescriptor.GetConverter(typeof(Size)).ConvertFromInvariantString(_size);
// Don't do anything if the screen config has since changed (otherwise windows vanish off the side)
if (screenconfig() == new MD5Sum((string) r.GetValue("screenconfig")))
{
form.Location = location;
form.Size = size;
// Don't restore if miminised (it's unhelpful as the user misses the fact it's opened)
if (state != FormWindowState.Minimized)
form.WindowState = state;
}
}
catch (Exception)
{
}
}
}
}
示例6: FormLayout
internal FormLayout(DlgBase form)
{
if (Program.IsClosing || ((!form.Disposing && !form.IsDisposed) && (form.WindowState != FormWindowState.Minimized)))
{
this.mBounds = form.Bounds;
if (this.mBounds.X == -32000)
{
this.mBounds.X = 0;
}
if (this.mBounds.Y == -32000)
{
this.mBounds.Y = 0;
}
if (form.WindowState == FormWindowState.Minimized)
{
this.mWindowState = FormWindowState.Normal;
}
else
{
this.mWindowState = form.WindowState;
}
this.mSaveLoadData = form.LayoutData;
this.mWasOpenOnExit = (Program.IsClosing && form.AllowRestoreWindow) && form.Visible;
this.mFormType = form.GetType();
}
}
示例7: Launcher_Load
private void Launcher_Load(object sender, EventArgs e)
{
this.Icon = DnDCS.Win.Libs.Assets.AssetsLoader.LauncherIcon;
initialFormTopMost = this.TopMost;
initialFormBorderStyle = this.FormBorderStyle;
initialFormWindowState = this.WindowState;
if (this.runMode.HasValue)
{
switch (this.runMode.Value)
{
case Constants.RunMode.Client:
this.btnClient.PerformClick();
break;
case Constants.RunMode.Server:
this.btnServer.PerformClick();
break;
default:
break;
}
}
}
示例8: FormNalog
public FormNalog(Terminal _terminal, Katalog _katalog, Point _koordinate, int _širina, int _visina, FormWindowState _stanje, KNalog _nalog)
: base(_terminal, _katalog, _koordinate, _širina, _visina, _stanje)
{
InitializeComponent();
dgvNalog.AutoGenerateColumns = false;
dgvNalog.Columns["colPromet"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
dgvNalog.Columns["colSken"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
this.nalog = _nalog;
txtDok.Focus();
CoreScannerProxy.Instance.BarcodeEvent += new BarcodeEventHandler(OnBarcode); // Događaj za očitanje barkoda.
if (nalog != null)
{
txtDok.Text =
this.nalog.dokVrsta +
this.nalog.sklaOznaka +
(this.nalog.dokVrsta == "PSS" ? this.nalog.sklaOznakaPSS : String.Empty) +
this.nalog.dokBr +
((from r in this.katalog.dokumenti where r.vrsta == this.nalog.dokVrsta select r).Single().oznaka);
PrikažiNalog(
this.nalog.sklaOznaka,
this.nalog.sklaOznakaPSS,
this.nalog.dokVrsta,
this.nalog.dokBr,
this.nalog.smjer);
}
}
示例9: WindowLocation
/// <summary>
/// Initializes a new instance of the WindowLocation class.
/// </summary>
/// <param name="input">The input string.</param>
public WindowLocation(string input)
{
Param.AssertValidString(input, "input");
string[] sections = input.Split(',');
if (sections.Length < 5)
{
throw new ArgumentException(string.Format(
CultureInfo.CurrentCulture, Strings.InvalidWindowLocationInputString, input));
}
this.location.X = Convert.ToInt32(sections[0], null);
this.location.Y = Convert.ToInt32(sections[1], null);
this.size.Height = Convert.ToInt32(sections[2], null);
this.size.Width = Convert.ToInt32(sections[3], null);
int state = Convert.ToInt32(sections[4], null);
if (state < 0)
{
this.state = FormWindowState.Minimized;
}
else if (state > 0)
{
this.state = FormWindowState.Maximized;
}
else if (state == 0)
{
this.state = FormWindowState.Normal;
}
}
示例10: OnLocationChanged
protected override void OnLocationChanged(EventArgs e)
{
base.OnLocationChanged(e);
if (WindowState != FormWindowState.Minimized)
LastNonMinimizedState = WindowState;
}
示例11: Initialize
public void Initialize(Rectangle position, FormWindowState state, bool detailView, bool loggerTree)
{
WindowPosition = position;
WindowState = state;
ShowLogDetailView = detailView;
ShowLoggerTree = loggerTree;
}
示例12: activateForm
public void activateForm(Form f, FormWindowState ws, FormStartPosition fs)
{
demandBackup = true;
foreach (Form each in MdiChildren)
{
if ((string)each.Tag != "1")
{
each.Close();
}
}
if (fs == FormStartPosition.Manual)
{
f.StartPosition = FormStartPosition.Manual;
int w = this.Width;
int h = this.Height;
f.Left = (w - f.Width) / 4;
f.Top = (h - f.Height) / 6;
}
else
{
f.StartPosition = fs;
}
f.WindowState = ws;
f.MdiParent = this;
f.ControlBox = false;
f.Show();
}
示例13: FormRobneLokacije
public FormRobneLokacije(Terminal _terminal, Katalog _katalog, Point _koordinate, int _širina, int _visina, FormWindowState _stanje)
: base(_terminal, _katalog, _koordinate, _širina, _visina, _stanje)
{
InitializeComponent();
dgvRobneLokacije.AutoGenerateColumns = false;
CoreScannerProxy.Instance.BarcodeEvent += new BarcodeEventHandler(OnBarcode); // Događaj za očitanje barkoda.
txtŠifraIliBarkod.Select();
ddlSkladište.DataSource = this.katalog.skladišta;
try
{
zadanoSkladište = ConfigurationManager.AppSettings["ZadanoSkladište"];
if (String.IsNullOrEmpty(zadanoSkladište))
{
return;
}
for (int i = 0; i < ddlSkladište.Items.Count; i++)
{
if (((KSkladiste)ddlSkladište.Items[i]).oznaka == ConfigurationManager.AppSettings["ZadanoSkladište"])
{
ddlSkladište.SelectedIndex = i;
break;
}
}
}
catch (ConfigurationErrorsException)
{
// Pojeo vuk magare iliti On error resume next.
}
}
示例14: BindGrid
private void BindGrid(DbConnection conn)
{
conn.Open();
_schema = new DataSet();
var schema = conn.GetSchema();
foreach (DataRow dataRow in schema.Rows)
{
var tableName = dataRow["CollectionName"].ToString();
if(!_schema.Tables.Contains(tableName))
{
var dt = conn.GetSchema(tableName);
dt.TableName = tableName;
_schema.Tables.Add(dt);
}
}
conn.Close();
dgSchema.DataSource = _schema.Tables[0];
cbTable.DataSource = _schema.Tables[0];
cbTable.DisplayMember = "CollectionName";
cbTable.ValueMember = "CollectionName";
_previousWidth = dgSchema.Width;
_previousState = WindowState;
}
示例15: Save
public void Save(Form targetForm)
{
winState = targetForm.WindowState;
brdStyle = targetForm.FormBorderStyle;
topMost = targetForm.TopMost;
bounds = targetForm.Bounds;
}