[Library][VB.NET].NET簡易測試用表單類別
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /white-space: pre;/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }]]> 測試用表單畫面秀圖界面 訊息界面 清單界面 選取界面 屬性界面 表格界面 使用範例 使用範例如下:Public Class Form1 Private Sub btnShowPhoto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowPhoto.Click Dim openDlg As New OpenFileDialog openDlg.Filter = “Photo file|.bmp;.jpg” If openDlg.ShowDialog = Windows.Forms.DialogResult.OK Then TestForm.ShowChart(“Photo”, openDlg.FileName) End If End Sub Private Sub btnShowFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowFile.Click Dim openDlg As New OpenFileDialog openDlg.Filter = “Text file|.txt” If openDlg.ShowDialog = Windows.Forms.DialogResult.OK Then TestForm.ShowMsg(“Text”, My.Computer.FileSystem.ReadAllText(openDlg.FileName)) End If End Sub Private Sub btnShowFileContent_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowFileContent.Click Dim selectedItem As Object = Nothing Dim folderDlg As New FolderBrowserDialog If folderDlg.ShowDialog = Windows.Forms.DialogResult.OK Then If TestForm.ShowListSelectDlg(“Select File”, My.Computer.FileSystem.GetFiles(folderDlg.SelectedPath, FileIO.SearchOption.SearchTopLevelOnly, ".txt"), selectedItem) = Windows.Forms.DialogResult.OK Then TestForm.ShowMsg(My.Computer.FileSystem.ReadAllText(selectedItem.ToString)) End If End If End Sub Private Sub btnSetProperty_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetProperty.Click TestForm.ShowPropertySettingDlg(Me) End Sub Private Sub btnShowFileList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowFileList.Click Dim folderDlg As New FolderBrowserDialog If folderDlg.ShowDialog = Windows.Forms.DialogResult.OK Then TestForm.ShowListDlg(My.Computer.FileSystem.GetFiles(folderDlg.SelectedPath)) End If End Sub Private Sub btnShowGrid_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowGrid.Click Dim dt As New DataTable dt.Columns.Add() TestForm.ShowGridDlg(dt) End SubEnd Class