how to click on a button through code? HELP - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

how to click on a button through code? HELP

darktowndarktown Posts: 2Member
[b][red]This message was edited by darktown at 2004-3-9 1:49:59[/red][/b][hr]
sorry i am new at this, maybe stupid question : -->

how can i click on a button through code?

i got : cmdAdd
but cdmAdd_click needs specific parameters?
is this the way to click through code or is there another way?

AddHandler cmdTest.Click, AddressOf cmdTest_Click
doesn't work either!!
i have put lbltest.text ="test" in the click and he doens't do it.


thx


Comments

  • Xtreme.NETXtreme.NET Posts: 112Member
    why would you wanna do that??
    i am guessing there is some code you wanna utilize whem something happens right???
    if thats the case, you can try to make a fn or something and utilize it...
    if there is another logic, i would love to hear about it..
    [size=1][COLOR=chocolate]"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."[i]1Thess. 5:16-18[/i][/color][/size]

  • darktowndarktown Posts: 2Member
    : why would you wanna do that??
    : i am guessing there is some code you wanna utilize whem something happens right???
    : if thats the case, you can try to make a fn or something and utilize it...
    : if there is another logic, i would love to hear about it..
    : [size=1][COLOR=chocolate]"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."[i]1Thess. 5:16-18[/i][/color][/size]
    :
    :

    sorry it was just
    cmdAdd_click(me,e)
  • RelmanRelman Posts: 104Member
    : : why would you wanna do that??
    : : i am guessing there is some code you wanna utilize whem something happens right???
    : : if thats the case, you can try to make a fn or something and utilize it...
    : : if there is another logic, i would love to hear about it..
    : : [size=1][COLOR=chocolate]"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."[i]1Thess. 5:16-18[/i][/color][/size]
    : :
    : :
    :
    : sorry it was just
    : cmdAdd_click(me,e)
    :

    By the way, that code will only work when you are trying to click on it using something that has "e" as a parameter. To do that within a procedure that doesn't have "e" as one of it parameters you should do something like:
    Dim e as new eventargs()
    cmdAdd_click(me,e) 'Like you said
    Also some controls require different "e"'s, so you wil have to change the "Dim" statement to "Dim" it as that kind. Some require stuff to be added in the brackets as well. I hope that this helps.

    Relman
  • kainsworthkainsworth Posts: 200Member
    I use:

    btnAdd.PerformClick

    the PerformClick method being built in. I know it works OK if the button is reated at designtime, but haven't tried with buttons created dynamically at runtime.

Sign In or Register to comment.