Results 1 to 2 of 2

Thread: Msgbox buttons

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2003
    Posts
    55

    Msgbox buttons

    VB Code:
    1. Private Sub cmdclear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdclear.Click
    2.         MsgBox("Are you sure you want to clear the PASSWORD box?", MsgBoxStyle.YesNo)
    3.         txtpass.Text = ""
    4.     End Sub

    well its prob easy for all u lot as ur genious for me its difficult lol

    i want it so if yes is pressed then the txtpass will clear if no then nutin will happen :/

    i fort it mite b

    if msgbox = yes then
    txtpass.text = ""

    but nope ;/

    n e help please or link for article

    thank you your all gr8

  2. #2
    Addicted Member
    Join Date
    Aug 2003
    Posts
    153
    The msgbox class is in there just for backward compatiability with VB6. In new code you should be using the Messagebox class.

    ie to solve your problem


    VB Code:
    1. Dim dlgConfirm As DialogResult
    2.  
    3.  
    4. dlgConfirm = Messagebox.Show("Are you sure you want to clear the PASSWORD box?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    5.  
    6. If dlgConfirm = DialogResult.Yes Then
    7. txtPass.Text = ""
    8. End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width