Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Changing text on button in MessageBox

Changing text on button in MessageBox

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ctlqt12
    wrote on last edited by
    #1

    Hi all, How could i change text on button in MessageBox? Ex : If i write : MessageBox.Show("How to change text","Question",MessageBoxButtons.OKCancel) -> MessageBox will be shown with "OK" and "Cancel" button. But i want to change text "OK" -> "That's right" and "Cancel" -> "That's not right". How could i do that?

    D K 2 Replies Last reply
    0
    • C ctlqt12

      Hi all, How could i change text on button in MessageBox? Ex : If i write : MessageBox.Show("How to change text","Question",MessageBoxButtons.OKCancel) -> MessageBox will be shown with "OK" and "Cancel" button. But i want to change text "OK" -> "That's right" and "Cancel" -> "That's not right". How could i do that?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You can't. The things you see in a MessageBox are not cusomtizable. You'll have to create your own form class that provides this functionality. It's not that hard. It's just a normal form with a couple of buttons and a label. Maybe even a picturebox if you want.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      1 Reply Last reply
      0
      • C ctlqt12

        Hi all, How could i change text on button in MessageBox? Ex : If i write : MessageBox.Show("How to change text","Question",MessageBoxButtons.OKCancel) -> MessageBox will be shown with "OK" and "Cancel" button. But i want to change text "OK" -> "That's right" and "Cancel" -> "That's not right". How could i do that?

        K Offline
        K Offline
        koolprasad2003
        wrote on last edited by
        #3

        hellllo ctlqt, Dave is correct "The things you see in a MessageBox are not cusomtizable" U can use form.showDialog() method to show ModelDialog, just create a form looklike message box and call it as modelDialog box regards, koolprasad2003:) Be a good listener...Because Opprtunity knoughts softly...N-Joy

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups