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. how to handle a change on a runtime combobox value to enable the OKbutton

how to handle a change on a runtime combobox value to enable the OKbutton

Scheduled Pinned Locked Moved Visual Basic
databasedesigntutorialquestion
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.
  • D Offline
    D Offline
    David M J
    wrote on last edited by
    #1

    Hi, I have created a number of form for user input, as they are more or the same I created a routine that creates the form in runtime (adding all the controls at runtime). What I now want to do is to have the save button to get enabled as soon as one of the controls has been changed. As I don't have the controls on the form during design time I am having problems using a eventhandler, basically I don't know how. So what I am asking is how do I create an eventhandler, or something else, in the controls I am adding that trigger an event on the form so that I can enable the Save button. Any pointers would be much appreciated. DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    R 1 Reply Last reply
    0
    • D David M J

      Hi, I have created a number of form for user input, as they are more or the same I created a routine that creates the form in runtime (adding all the controls at runtime). What I now want to do is to have the save button to get enabled as soon as one of the controls has been changed. As I don't have the controls on the form during design time I am having problems using a eventhandler, basically I don't know how. So what I am asking is how do I create an eventhandler, or something else, in the controls I am adding that trigger an event on the form so that I can enable the Save button. Any pointers would be much appreciated. DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

      R Offline
      R Offline
      rwestgraham
      wrote on last edited by
      #2

      Well, you did not specify VB6 or VB.NET, so I will not give much detail. Basically the approach is: VB6 - you have to already have a placeholder control of every type you want add at runtime and add then as a control array. So you just write a single handler and enable the the save button when anyone changes. Or you could process each control in a different way if you know in advance what their array indexes will be. VB.NET Create event handlers and add them to the dynamic controls using the syntax: AddHandler AddressOf Robert

      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