منبع:https://barnamenevis.org/showpo...5&postcount=36
کد:
TextBox1.Font = New Font(TextBox1.Font, FontStyle.Bold Or FontStyle.Italic Or FontStyle.Underline)
منبع:https://barnamenevis.org/showpo...5&postcount=36
کد:
TextBox1.Font = New Font(TextBox1.Font, FontStyle.Bold Or FontStyle.Italic Or FontStyle.Underline)
https://barnamenevis.org/showpo...0&postcount=38
برای مثال :
کد:
Dim path As String = Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles)
سایر مسیرها قابل دستیابی با این روش :
کد:
Desktop, MyDocuments, System, ...
منبع:https://barnamenevis.org/showpo...2&postcount=39
کد:
'// read text file
richTextBox1.LoadFile("C:\Log.txt", RichTextBoxStreamType.UnicodePlainText)
'// save text file
richTextBox1.SaveFile("C:\Log.txt", RichTextBoxStreamType.UnicodePlainText)
منبع:https://barnamenevis.org/showpo...5&postcount=40
کد:
<DllImport("user32.dll")> _
Shared Function ReleaseCapture() As Integer
End Function
Declare Auto Function SendMessageA Lib "user32.dll" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Object) As Integer
Private Const WM_NCLBUTTONDOWN As Integer = 161
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
ReleaseCapture()
SendMessageA(Me.Handle.ToInt32(), WM_NCLBUTTONDOWN, 2, 0)
End Sub
منبع:https://barnamenevis.org/showpo...2&postcount=41
ابتدا System.Management رو به References پروژه بیفزایید و سپس :
کد:
Imports System.Management
Private Sub GetHDDSerialNumber()
Dim searcher As ManagementObjectSearcher
Dim query1 As String = "SELECT * FROM Win32_DiskDrive"
Dim query2 As String = "SELECT * FROM Win32_PhysicalMedia"
searcher = New ManagementObjectSearcher(query1)
For Each wmi_HD As ManagementObject In searcher.Get()
If Not wmi_HD("Model") Is Nothing Then
MessageBox.Show(wmi_HD("Model").ToString())
End If
Next
searcher = New ManagementObjectSearcher(query2)
For Each wmi_HD As ManagementObject In searcher.Get()
If Not wmi_HD("SerialNumber") Is Nothing Then
MessageBox.Show(wmi_HD("SerialNumber").ToString())
End If
Next
End Sub
منبع:https://barnamenevis.org/showpo...7&postcount=43
کد:
System.Diagnostics.Process.Start("mspaint.exe")
چنانچه فایل اجرایی نیاز به آرگومان خط فرمان داشته باشد :
کد:
System.Diagnostics.Process.Start("mspaint.exe", "c:\Test.bmp")
مثال بالا تصویر Test را در msPaint باز میکند.
منبع:https://barnamenevis.org/showpo...1&postcount=44
کد:
Dim myString1 As String = "This is the first line of my string." + vbCrLf _
+ "This is the second line of my string." + vbCrLf + _
"This is the third line of the string." + vbCrLf