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. Windows Forms
  4. caption/text property of Button control

caption/text property of Button control

Scheduled Pinned Locked Moved Windows Forms
questionannouncement
4 Posts 4 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.
  • V Offline
    V Offline
    vinayh
    wrote on last edited by
    #1

    I want to handle Edit and update both from one Button control in Winform2008, let me know , how can I do this….

    Vinay

    A D A 3 Replies Last reply
    0
    • V vinayh

      I want to handle Edit and update both from one Button control in Winform2008, let me know , how can I do this….

      Vinay

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      Set/check the text of the button in the onclick event.

      Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

      1 Reply Last reply
      0
      • V vinayh

        I want to handle Edit and update both from one Button control in Winform2008, let me know , how can I do this….

        Vinay

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

        Not enough information to answer your question. The biggest problem with this design is how is the button click handler going to know the difference in the users intent when the button is clicked??

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008
        But no longer in 2009...

        1 Reply Last reply
        0
        • V vinayh

          I want to handle Edit and update both from one Button control in Winform2008, let me know , how can I do this….

          Vinay

          A Offline
          A Offline
          Arindam Sinha
          wrote on last edited by
          #4

          Keep a Form level variable to get the mode of the screen.

          private String mode = "Edit";

          Now change this mode whenever, your form's mode is being changed. Based on this private varible you can decide the text of the button.

          btnSave.Text = (mode == "Edit")?"Edit" : "Update";

          Hope this yould help you. :) Regards, Arindam Sinha

          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