Switch the window customized and normal
Overview
Switch the window customized and normal.
Specification of this example
Behavior
When click the "Select Folder" button on the PanDA form, show the dialog box that selected the normal window.
After selected the folder and click the "Change Layout" button, change the normal window.
Screenshot
How to try this example
1.Click the link below, then the folder containing zip file automatically opens.
File
2.Right-click and hold on the zip file, and drop it on working window of FJ system, then the demo-tool automatically starts.
3.Click "Start PanDA Form" button in the program, then the PanDA form will start.
4.When click the "Select Folder" button on the PanDA form, show the dialog box that selected the normal window.
5.After selected the folder and click the "Change Layout" button, change the normal window.
How to implement
Process of UI unit
Imports System
Imports System.Windows.Forms
Imports System.IO
Public Class Form1
Private Sub btnSelectFolder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectFolder.Click
'(1)
Dim result As DialogResult = FolderBrowserDialog1.ShowDialog()
'(2)
If result = Windows.Forms.DialogResult.OK Then
Dim filePath As String = FolderBrowserDialog1.SelectedPath
If System.IO.File.Exists(filePath + "\FZ-CoreRA.exe") = True Then
btnChangeLayout.Enabled = True
Else
btnChangeLayout.Enabled = False
End If
End If
End Sub
Private Sub btnChangeLayout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChangeLayout.Click
Dim filePath As String = FolderBrowserDialog1.SelectedPath
'(3)
Me.Hide()
Shell(filePath + "\FZ-CoreRA.exe", vbNormalFocus)
End
End Sub
End Class
Explanation
(1)Display the dialog to select folder.
(2)If there is "FZ-CoreRA.exe" in the selected folder, enable the "Change Layout" button.
(3)Show the normal window, and then close the PanDA form.
Source codes
Total source codes can be get from
here.