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. C#
  4. Suppress click at load???

Suppress click at load???

Scheduled Pinned Locked Moved C#
databasewindows-adminhelpquestion
2 Posts 2 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.
  • B Offline
    B Offline
    betterc
    wrote on last edited by
    #1

    I create a group of radio buttons so the user can select the database they want. When the user clicks one of the buttons, the event issues a detatch and re-attach to the proper database. The problem I am having is that during the form load I read the registry to find the current selection and then set the radio buttons showing which one has been checked by issuing a xyz.Checked = true; This then forces a click event which causes the db to detach/reattach. I only want the db to detach/reattach when the radio button is cliked by the user not during load. I get the same stuff using the CheckedChanged event and setting a bool first time pass doesn't seem to do the trick either. Thanks, Craig

    H 1 Reply Last reply
    0
    • B betterc

      I create a group of radio buttons so the user can select the database they want. When the user clicks one of the buttons, the event issues a detatch and re-attach to the proper database. The problem I am having is that during the form load I read the registry to find the current selection and then set the radio buttons showing which one has been checked by issuing a xyz.Checked = true; This then forces a click event which causes the db to detach/reattach. I only want the db to detach/reattach when the radio button is cliked by the user not during load. I get the same stuff using the CheckedChanged event and setting a bool first time pass doesn't seem to do the trick either. Thanks, Craig

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      The obvious solution is to use a state variable. While loading, this variable could be unset. Once the form is done loading (say, in the OnLoad override in your Form), set this variable. In your client event handler, determine if the variable is set. Only then do you execute your code.

      Microsoft MVP, Visual C# My Articles

      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