wText.PadLeft(6, CChar("0"))
New String("0"c, 5) '00000
Dim wStr_Ary() As String
wStr_Ary = wText.Split(","c)
Dim SJis As System.Text.Encoding = System.Text.Encoding.GetEncoding("Shift_JIS")
Dim wStr As String = "ABCDE"
If (wStr.Length * 2 > SJis.GetByteCount(wStr)) Then
'半角文字あり
ELSE
'半角文字なし
End If
Dim St1 As String
St1 = StrConv("アイウABC", VbStrConv.Wide)
Me.GetType.Assembly.GetName
Dim str As String = "001-____"
'VisualBasic
Replace(str, "_", " ")
'System.String クラス
str.Replace("_", " ")
Dim wInt As Integer
If (Integer.TryParse("-12.34", wInt)) Then
Else
End If
System.Text.Encoding.GetEncoding("Shift_JIS").GetByteCount(stTarget)
CType(Me.Controls("lbl"), System.Windows.Forms.Label).Text = "ABC"
VisalBasic
'この例では月数の差は1となる。1日(月の初めの日)を何回またいでいるかを数えている。
DateDiff(DateInterval.Month, #12/25/2004#, #1/12/2005#)
Dim wStr_text As String
If (wStr_text.Contains("希望") = True) Then
End If
【PadLeft】第2引数を省略すると、半角スペースで埋まるようになります。
Public Function Gfnc_Check(ByVal Gstr_CD As String, _
Optional ByVal Gbln As Boolean = False) As Integer
End Function
For Each w_ctrl As Control In Me.Controls
If (TypeOf w_ctrl Is CheckBox) AndAlso _
(TryCast(w_ctrl, CheckBox).Checked = True) Then
Exit For
End If
Next
Dim Pobj_Con As New SqlConnection()
'db接続処理・・・・
Me.Label1.Text = "接続サーバー:" & Pobj_Con.WorkstationId
Dim wDate As Date
If (Date.TryParseExact("20110210", "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture, _
Globalization.DateTimeStyles.None, wDate) = True) Then
End If
Dim DTbl As DataTable = New DataTable
Dim DRow As DataRow
DTbl.Columns.Add("ID", GetType(Integer))
DTbl.Columns.Add("Name", GetType(String))
DRow = DTbl.NewRow
DRow("ID") = 1
DRow("Name") = "名前"
DTbl.Rows.Add(DRow)
'処理開始時刻を記憶
Dim start As DateTime = Now
'処理時間を計算(現在時刻-処理開始時刻)
Dim span As TimeSpan = Now - start
MessageBox.Show(String.Format("処理時間は{0}秒です。", span.TotalSeconds))
'Label1を再描画する
ME.Label1.Update()
' System.Windows.Forms.Application.DoEvents() を使用しない
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AddHandler Button1.Click, New EventHandler(AddressOf button2_Click)
AddHandler Button1.Click, AddressOf button3_Click
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show("Button1")
End Sub
Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("Button2")
End Sub
Private Sub button3_Click(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("Button3")
End Sub
IO.Directory.GetCurrentDirectory()
最終更新:2011年05月18日 12:52