公告版位
沒有痛苦 就沒有收穫
若內容對你有幫助,可以留言讓我知道哦~
有問題想要諮詢可以請至這裡連絡我哦 =>不會就放這邊
目前分類:VB (121)
- Sep 30 Mon 2019 15:12
【VB】WebBrowser網址編碼器
- Sep 16 Mon 2019 11:55
【VB】PictureBox.SizeMode範例
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
範例
Dim PictureBox1 As New PictureBox() Dim WithEvents Button1 As New Button <STAThread()> _ Public Shared Sub Main() Application.EnableVisualStyles() Application.Run(New Form1()) End Sub Private Sub InitializePictureBoxAndButton() Me.Controls.Add(PictureBox1) Me.Controls.Add(Button1) Button1.Location = New Point(175, 20) Button1.Text = "Stretch" ' Set the size of the PictureBox control. Me.PictureBox1.Size = New System.Drawing.Size(140, 140) 'Set the SizeMode to center the image. Me.PictureBox1.SizeMode = PictureBoxSizeMode.CenterImage ' Set the border style to a three-dimensional border. Me.PictureBox1.BorderStyle = BorderStyle.Fixed3D ' Set the image property. Me.PictureBox1.Image = New Bitmap(GetType(Button), "Button.bmp") End Sub Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click ' Set the SizeMode property to the StretchImage value. This ' will enlarge the image as needed to fit into ' the PictureBox. PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage End Sub
- Sep 12 Thu 2019 14:14
【VB】 Try...Catch...Finally語法
VB語法 Try...Catch...Finally 範例
Try Process.Start("http://www.microsoft.com") Catch ex As Exception MsgBox("Can't load Web page" & vbCrLf & ex.Message) End Try
- Sep 12 Thu 2019 14:11
【VB】 Select...Case 範例
VB Select...Case語法範例 https://docs.microsoft.com/zh-tw/dotnet/visual-basic/language-reference/statements/select-case-statement
Dim number As Integer = 8 Select Case number Case 1 To 5 Debug.WriteLine("Between 1 and 5, inclusive") ' The following is the only Case clause that evaluates to True. Case 6, 7, 8 Debug.WriteLine("Between 6 and 8, inclusive") Case 9 To 10 Debug.WriteLine("Equal to 9 or 10") Case Else Debug.WriteLine("Not between 1 and 10, inclusive") End Select
- Sep 03 Tue 2019 11:26
【軟體工具】取代Visual Studio的開源軟體 - SharpDevelop
今天在搜尋visual studio序號價錢時 ,看到這篇文章介紹,目前,有個團隊研發「SharpDevelop」的開源程式,介面大概跟Visual Studio 有著87%像阿!!
目前已經用這麼做了一專案,目前上沒有任何相容性的問題,額外的參考檔也是妥妥的可以加入,如果要省去序號價錢的朋友可以考慮這款...
官方網站 http://www.icsharpcode.net/OpenSource/SD/Default.aspx 真心覺得開發出這個軟體的人真的超屌,還開源程式碼給你
- Jul 25 Thu 2019 11:56
【VB】hex to ascii
VB十六進制轉ASCII方法
Public Function AsciiStringToHexString(ByVal asciiString As String) As String Dim ascii() As Byte = System.Text.Encoding.Default.GetBytes(asciiString) Dim count As Integer = ascii.Length Dim hexArray(count - 1) As String For idx As Integer = 0 To count - 1 hexArray(idx) = ascii(idx).ToString("x2") Next Return String.Join(" ", hexArray) End Function Public Function HexStringToAsciiString(ByVal hexString As String) As String Dim array() As String = hexString.Split(New Char() {" "c}, StringSplitOptions.RemoveEmptyEntries) For idx As Integer = 0 To array.Length - 1 array(idx) = Chr(CInt(String.Format("&h{0}", array(idx)))) Next Return String.Join(String.Empty, array) End Function Private Sub tbxASCII_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbxASCII.TextChanged If Me.ActiveControl Is sender Then tbxHex.Text = AsciiStringToHexString(tbxASCII.Text) End If End Sub Private Sub tbxHex_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbxHex.TextChanged If Me.ActiveControl Is sender Then tbxASCII.Text = HexStringToAsciiString(tbxHex.Text) End If End Sub End Class
- May 03 Fri 2019 09:30
【VB】控制項是什麼?
- May 03 Fri 2019 09:29
【VB】找出panel內所有Lable名稱
- May 03 Fri 2019 09:26
【VB】Textbox換行與不換行
- May 02 Thu 2019 10:13
【VB】把中文日文英文變成URL編碼
如標題 如何把中日英文變成URL編碼
在IE上 如果輸入中文 或許還可以搜尋 ,但遇上日文字就問號亂碼給你看,但其他瀏覽器事不會發生
因此要避免這問題,先把中日英文字轉成"URL"編碼,就不會這問題囉
- May 02 Thu 2019 10:08
【VB】HttpUtility不存在錯誤訊息
- Apr 08 Mon 2019 10:18
【VB】選擇ComboBox同步更新Textbox1數值
情境:假設 我有一個combox1 和一個 Textbox1 , 我選擇Combox1上面選項時要同時更動textbox1上的數值
方法如下:
要做這個功能要用 底下的SelectedIndex 在textbox1上面顯示
- Mar 28 Thu 2019 13:22
【VB】刪除檔案語法
My.Computer.FileSystem 物件的 DeleteFile 方法可讓您刪除檔案。 提供的選項包括︰是否要將已刪除的檔案傳送至 [資源回收筒]、是否要求使用者確認應該刪除檔案,以及使用者取消該作業時該怎麼辦。 刪除文字檔 使用 DeleteFile 方法來刪除檔案。 下列程式碼示範如何刪除名為 test.txt 的檔案。
My.Computer.FileSystem.DeleteFile("C:\test.txt")
刪除文字檔並要求使用者確認應該刪除檔案 使用 DeleteFile 方法來刪除檔案,並將 showUI 設定為 AllDialogs。 下列程式碼示範如何刪除名為 test.txt 的檔案,並讓使用者確認應該刪除檔案。
- Mar 27 Wed 2019 15:15
【VB】判斷輸入為數字
VB - 如何判斷輸入是否為數字
if NOT IsNumeric(TextBox1.Text) Then MessageBox.Show ("欄位輸入必須為數值") Exit Sub End If
- Mar 27 Wed 2019 15:12
【VB】ASCII String to Hex String
Public Function AsciiStringToHexString(ByVal asciiString As String) As String Dim ascii() As Byte = System.Text.Encoding.Default.GetBytes(asciiString) Dim count As Integer = ascii.Length Dim hexArray(count - 1) As String For idx As Integer = 0 To count - 1 hexArray(idx) = ascii(idx).ToString("x2") Next Return String.Join(" ", hexArray) End Function Public Function HexStringToAsciiString(ByVal hexString As String) As String Dim array() As String = hexString.Split(New Char() {" "c}, StringSplitOptions.RemoveEmptyEntries) For idx As Integer = 0 To array.Length - 1 array(idx) = Chr(CInt(String.Format("&h{0}", array(idx)))) Next Return String.Join(String.Empty, array) End Function Private Sub tbxASCII_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbxASCII.TextChanged If Me.ActiveControl Is sender Then tbxHex.Text = AsciiStringToHexString(tbxASCII.Text) End If End Sub Private Sub tbxHex_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbxHex.TextChanged If Me.ActiveControl Is sender Then tbxASCII.Text = HexStringToAsciiString(tbxHex.Text) End If End Sub
- Mar 27 Wed 2019 15:11
【VB】DataGridView欄位寬度
- Mar 27 Wed 2019 15:10
【VB】修改檔名語法
- Mar 26 Tue 2019 13:26
【VB】尋找相同檔名的檔案
如何尋找同一資料夾副檔名相同的檔案?
Dim FileName As String Dim result(100) As String Dim count As Integer FileName = Dir("C:\temp\*.txt", vbNormal) count = 0 Do While FileName <> "" Debug.Print FileName result(count) = FileName FileName = Dir count = count + 1 Loop
- Mar 26 Tue 2019 10:56
【VB】 清除矩陣語法
Dim sample_voltage(5800) As Integer
Array.Clear(sample_voltage, 0, sample_voltage.Length) ' 清除矩陣