C# と VB.NET の質問掲示板

ASP.NET、C++/CLI、Java 何でもどうぞ

ログ内検索
  • キーワードを複数指定する場合は 半角スペース で区切ってください。
  • 検索条件は、(AND)=[A かつ B] (OR)=[A または B] となっています。
  • [返信]をクリックすると返信ページへ移動します。
キーワード/ 検索条件 /
検索範囲/ 強調表示/ ON (自動リンクOFF)
結果表示件数/ 記事No検索/ ON
大文字と小文字を区別する

No.60359 の関連記事表示

<< 0 >>
■60359  Re[4]: validateの使い方
□投稿者/ shu -(2011/06/29(Wed) 15:17:11)
    VB.NETですがサンプルです。
    C#2008なら似たようなことは出来ると思います。
    
        Private m_act As Action = Nothing
    
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            If m_act IsNot Nothing Then
                m_act()
            End If
            m_act = Nothing
            Label1.Text = "Button1_Click"
        End Sub
    
        Private Sub TextBox1_Enter(sender As Object, e As System.EventArgs) Handles TextBox1.Enter
            If m_act IsNot Nothing Then
                m_act()
            End If
            m_act = Nothing
            Label1.Text = ""
        End Sub
    
        Private Sub TextBox2_Enter(sender As Object, e As System.EventArgs) Handles TextBox2.Enter
            If m_act IsNot Nothing Then
                m_act()
            End If
            m_act = Nothing
            Label1.Text = ""
        End Sub
    
        Private Sub TextBox1_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
            If TextBox1.Text = "1" Then
                MessageBox.Show("TextBox1_Validating Cancel", "TextBox1_Validating")
                e.Cancel = True
            Else
                m_act = Sub()
                            MessageBox.Show("TextBox1_Validating Accepted", "TextBox1_Validating")
                        End Sub
            End If
        End Sub
記事No.60352 のレス /過去ログ101より / 関連記事表示
削除チェック/



<< 0 >>

パスワード/

- Child Tree -