Add save/restore layout buttons to Monitoring grid
Added "Save Layout" and "Restore Default Layout" buttons to the Monitoring tab, allowing users to save and restore the grid layout for GridView5. The layout is persisted as an XML file in the user's app data directory. On form load, the layout is restored if the file exists. Button event handlers provide user feedback, and control positions were adjusted to fit the new buttons.
This commit is contained in:
52
App/EmailProfiler.Form/frmMain.Designer.vb
generated
52
App/EmailProfiler.Form/frmMain.Designer.vb
generated
@@ -329,6 +329,7 @@ Partial Class frmMain
|
||||
Me.gridMonitoring = New DevExpress.XtraGrid.GridControl()
|
||||
Me.GridView5 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.pnlMonitoringConfig = New DevExpress.XtraEditors.PanelControl()
|
||||
Me.btnRefresh = New System.Windows.Forms.Button()
|
||||
Me.btnMonitoringConfig = New System.Windows.Forms.Button()
|
||||
Me.txtMonitoringConfig = New System.Windows.Forms.TextBox()
|
||||
Me.lblMonitoringConfig = New System.Windows.Forms.Label()
|
||||
@@ -344,7 +345,8 @@ Partial Class frmMain
|
||||
Me.TBEMLP_CONFIGTableAdapter = New EmailProfiler.Form.MyDatasetTableAdapters.TBEMLP_CONFIGTableAdapter()
|
||||
Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog()
|
||||
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.btnRefresh = New System.Windows.Forms.Button()
|
||||
Me.btnSaveLayout = New System.Windows.Forms.Button()
|
||||
Me.btnRestoreDefaultLayout = New System.Windows.Forms.Button()
|
||||
GUIDLabel = New System.Windows.Forms.Label()
|
||||
PROFILE_NAMELabel = New System.Windows.Forms.Label()
|
||||
POLL_TYPELabel = New System.Windows.Forms.Label()
|
||||
@@ -3453,6 +3455,8 @@ Partial Class frmMain
|
||||
'
|
||||
'pnlMonitoringConfig
|
||||
'
|
||||
Me.pnlMonitoringConfig.Controls.Add(Me.btnRestoreDefaultLayout)
|
||||
Me.pnlMonitoringConfig.Controls.Add(Me.btnSaveLayout)
|
||||
Me.pnlMonitoringConfig.Controls.Add(Me.btnRefresh)
|
||||
Me.pnlMonitoringConfig.Controls.Add(Me.btnMonitoringConfig)
|
||||
Me.pnlMonitoringConfig.Controls.Add(Me.txtMonitoringConfig)
|
||||
@@ -3463,9 +3467,21 @@ Partial Class frmMain
|
||||
Me.pnlMonitoringConfig.Size = New System.Drawing.Size(1221, 44)
|
||||
Me.pnlMonitoringConfig.TabIndex = 0
|
||||
'
|
||||
'btnRefresh
|
||||
'
|
||||
Me.btnRefresh.Image = Global.EmailProfiler.Form.My.Resources.Resources.refresh_16xLG
|
||||
Me.btnRefresh.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.btnRefresh.Location = New System.Drawing.Point(311, 10)
|
||||
Me.btnRefresh.Name = "btnRefresh"
|
||||
Me.btnRefresh.Size = New System.Drawing.Size(92, 23)
|
||||
Me.btnRefresh.TabIndex = 3
|
||||
Me.btnRefresh.Text = "Aktualisieren"
|
||||
Me.btnRefresh.TextAlign = System.Drawing.ContentAlignment.MiddleRight
|
||||
Me.btnRefresh.UseVisualStyleBackColor = True
|
||||
'
|
||||
'btnMonitoringConfig
|
||||
'
|
||||
Me.btnMonitoringConfig.Location = New System.Drawing.Point(220, 9)
|
||||
Me.btnMonitoringConfig.Location = New System.Drawing.Point(220, 10)
|
||||
Me.btnMonitoringConfig.Name = "btnMonitoringConfig"
|
||||
Me.btnMonitoringConfig.Size = New System.Drawing.Size(80, 23)
|
||||
Me.btnMonitoringConfig.TabIndex = 2
|
||||
@@ -3474,7 +3490,7 @@ Partial Class frmMain
|
||||
'
|
||||
'txtMonitoringConfig
|
||||
'
|
||||
Me.txtMonitoringConfig.Location = New System.Drawing.Point(147, 10)
|
||||
Me.txtMonitoringConfig.Location = New System.Drawing.Point(147, 11)
|
||||
Me.txtMonitoringConfig.Name = "txtMonitoringConfig"
|
||||
Me.txtMonitoringConfig.Size = New System.Drawing.Size(61, 21)
|
||||
Me.txtMonitoringConfig.TabIndex = 1
|
||||
@@ -3482,7 +3498,7 @@ Partial Class frmMain
|
||||
'lblMonitoringConfig
|
||||
'
|
||||
Me.lblMonitoringConfig.AutoSize = True
|
||||
Me.lblMonitoringConfig.Location = New System.Drawing.Point(23, 14)
|
||||
Me.lblMonitoringConfig.Location = New System.Drawing.Point(23, 15)
|
||||
Me.lblMonitoringConfig.Name = "lblMonitoringConfig"
|
||||
Me.lblMonitoringConfig.Size = New System.Drawing.Size(117, 13)
|
||||
Me.lblMonitoringConfig.TabIndex = 0
|
||||
@@ -3544,17 +3560,23 @@ Partial Class frmMain
|
||||
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
|
||||
Me.ContextMenuStrip1.Size = New System.Drawing.Size(61, 4)
|
||||
'
|
||||
'btnRefresh
|
||||
'btnSaveLayout
|
||||
'
|
||||
Me.btnRefresh.Image = Global.EmailProfiler.Form.My.Resources.Resources.refresh_16xLG
|
||||
Me.btnRefresh.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.btnRefresh.Location = New System.Drawing.Point(311, 9)
|
||||
Me.btnRefresh.Name = "btnRefresh"
|
||||
Me.btnRefresh.Size = New System.Drawing.Size(92, 23)
|
||||
Me.btnRefresh.TabIndex = 3
|
||||
Me.btnRefresh.Text = "Aktualisieren"
|
||||
Me.btnRefresh.TextAlign = System.Drawing.ContentAlignment.MiddleRight
|
||||
Me.btnRefresh.UseVisualStyleBackColor = True
|
||||
Me.btnSaveLayout.Location = New System.Drawing.Point(910, 10)
|
||||
Me.btnSaveLayout.Name = "btnSaveLayout"
|
||||
Me.btnSaveLayout.Size = New System.Drawing.Size(106, 23)
|
||||
Me.btnSaveLayout.TabIndex = 4
|
||||
Me.btnSaveLayout.Text = "Layout speichern"
|
||||
Me.btnSaveLayout.UseVisualStyleBackColor = True
|
||||
'
|
||||
'btnRestoreDefaultLayout
|
||||
'
|
||||
Me.btnRestoreDefaultLayout.Location = New System.Drawing.Point(1026, 10)
|
||||
Me.btnRestoreDefaultLayout.Name = "btnRestoreDefaultLayout"
|
||||
Me.btnRestoreDefaultLayout.Size = New System.Drawing.Size(183, 23)
|
||||
Me.btnRestoreDefaultLayout.TabIndex = 5
|
||||
Me.btnRestoreDefaultLayout.Text = "Standard-Layout wiederherstellen"
|
||||
Me.btnRestoreDefaultLayout.UseVisualStyleBackColor = True
|
||||
'
|
||||
'frmMain
|
||||
'
|
||||
@@ -3915,4 +3937,6 @@ Partial Class frmMain
|
||||
Friend WithEvents gridMonitoring As DevExpress.XtraGrid.GridControl
|
||||
Friend WithEvents GridView5 As DevExpress.XtraGrid.Views.Grid.GridView
|
||||
Friend WithEvents btnRefresh As Button
|
||||
Friend WithEvents btnRestoreDefaultLayout As Button
|
||||
Friend WithEvents btnSaveLayout As Button
|
||||
End Class
|
||||
|
||||
@@ -98,6 +98,11 @@ Public Class frmMain
|
||||
txtMonitoringConfig.Text = "500"
|
||||
End If
|
||||
LoadMonitoringIntoGrid()
|
||||
|
||||
Dim layoutPath As String = System.IO.Path.Combine(Application.UserAppDataPath, "gridMonitoringLayout.xml")
|
||||
If System.IO.File.Exists(layoutPath) Then
|
||||
GridView5.RestoreLayoutFromXml(layoutPath)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
||||
@@ -1087,4 +1092,20 @@ Public Class frmMain
|
||||
Private Sub btnRefresh_Click(sender As Object, e As EventArgs) Handles btnRefresh.Click
|
||||
LoadMonitoringIntoGrid()
|
||||
End Sub
|
||||
|
||||
Private Sub btnSaveLayout_Click(sender As Object, e As EventArgs) Handles btnSaveLayout.Click
|
||||
Dim layoutPath As String = System.IO.Path.Combine(Application.UserAppDataPath, "gridMonitoringLayout.xml")
|
||||
GridView5.SaveLayoutToXml(layoutPath)
|
||||
MessageBox.Show("Layout gespeichert!")
|
||||
End Sub
|
||||
|
||||
Private Sub btnRestoreDefaultLayout_Click(sender As Object, e As EventArgs) Handles btnRestoreDefaultLayout.Click
|
||||
Dim layoutPath As String = System.IO.Path.Combine(Application.UserAppDataPath, "gridMonitoringLayout.xml")
|
||||
If System.IO.File.Exists(layoutPath) Then
|
||||
System.IO.File.Delete(layoutPath)
|
||||
End If
|
||||
' Grid neu laden, damit das Defaultlayout angezeigt wird
|
||||
LoadMonitoringIntoGrid()
|
||||
MessageBox.Show("Standardlayout wurde wiederhergestellt!")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user