ConfigurationForm - add toolStripStatusLabelSavedSettingStatus to show saved settings status.

This commit is contained in:
DucDangAnh 2020-07-20 15:36:31 +07:00
parent 1671d3b456
commit aa1aae8c6c
3 changed files with 36 additions and 3 deletions

View File

@ -43,6 +43,9 @@
this.chkAllowUsePrinter = new System.Windows.Forms.CheckBox();
this.lblAllowAutoLogin = new System.Windows.Forms.Label();
this.chkAllowAutoLogin = new System.Windows.Forms.CheckBox();
this.statusStrip = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabelSavedSettingStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.statusStrip.SuspendLayout();
this.SuspendLayout();
//
// txtDoorDeviceControlAccessIPStatus
@ -66,7 +69,7 @@
// btnClose
//
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClose.Location = new System.Drawing.Point(528, 228);
this.btnClose.Location = new System.Drawing.Point(528, 207);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(106, 41);
this.btnClose.TabIndex = 7;
@ -77,7 +80,7 @@
// btnSaveSettings
//
this.btnSaveSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSaveSettings.Location = new System.Drawing.Point(416, 228);
this.btnSaveSettings.Location = new System.Drawing.Point(416, 207);
this.btnSaveSettings.Name = "btnSaveSettings";
this.btnSaveSettings.Size = new System.Drawing.Size(106, 41);
this.btnSaveSettings.TabIndex = 6;
@ -187,11 +190,28 @@
this.chkAllowAutoLogin.Text = "Sử dụng";
this.chkAllowAutoLogin.UseVisualStyleBackColor = true;
//
// statusStrip
//
this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabelSavedSettingStatus});
this.statusStrip.Location = new System.Drawing.Point(0, 259);
this.statusStrip.Name = "statusStrip";
this.statusStrip.Size = new System.Drawing.Size(646, 22);
this.statusStrip.TabIndex = 18;
this.statusStrip.Text = "statusStrip";
//
// toolStripStatusLabelSavedSettingStatus
//
this.toolStripStatusLabelSavedSettingStatus.Name = "toolStripStatusLabelSavedSettingStatus";
this.toolStripStatusLabelSavedSettingStatus.Size = new System.Drawing.Size(110, 17);
this.toolStripStatusLabelSavedSettingStatus.Text = "Cấu hình ứng dụng";
//
// ConfigurationForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(646, 281);
this.Controls.Add(this.statusStrip);
this.Controls.Add(this.txtDoorDeviceControlAccessIPStatus);
this.Controls.Add(this.btnCheckDoorDeviceControlAccessIP);
this.Controls.Add(this.btnClose);
@ -214,6 +234,8 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Cấu hình ứng dụng";
this.Load += new System.EventHandler(this.ConfigurationForm_Load);
this.statusStrip.ResumeLayout(false);
this.statusStrip.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -236,5 +258,7 @@
private System.Windows.Forms.CheckBox chkAllowUsePrinter;
private System.Windows.Forms.Label lblAllowAutoLogin;
private System.Windows.Forms.CheckBox chkAllowAutoLogin;
private System.Windows.Forms.StatusStrip statusStrip;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelSavedSettingStatus;
}
}

View File

@ -28,7 +28,13 @@ namespace AIParkingApplication
private void btnSaveSettings_Click(object sender, EventArgs e)
{
Util.UpsertAppSettings("DOOR_ACCESS_DEVICE_CONTROL_IP", txtDoorDeviceControlAccessIP.Text);
Util.UpsertAppSettings("AUTO_OPEN_DOOR_1", chkAllowAutoDoor1.Checked.ToString().ToLower());
Util.UpsertAppSettings("AUTO_OPEN_DOOR_2", chkAllowAutoDoor2.Checked.ToString().ToLower());
Util.UpsertAppSettings("USE_PRINTER", chkAllowUsePrinter.Checked.ToString().ToLower());
Util.UpsertAppSettings("ALLOW_CHANGE_ROI_RECT", chkAllowChangeROIRect.Checked.ToString().ToLower());
Util.UpsertAppSettings("AUTO_LOGIN", chkAllowAutoLogin.Checked.ToString().ToLower());
toolStripStatusLabelSavedSettingStatus.Text = $"{DateTime.Now.GetTimeFormatted()}\tĐã lưu cài đặt";
}
private void ConfigurationForm_Load(object sender, EventArgs e)

View File

@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>