954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

command button

is there anyway by which i can check whether a command button has been clicked or not...

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

actually to check in my project whether a command button present in my dll has been clicked and based on that i have to do further processing......
is there any way out...

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Hi Anud,

Just Keep a Public Form Level Boolean Variable, and Make that true When Comman button is Clicked. and check based on that

Regards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

actually....how do i make the code written in my project wait until the command button in the module has been clicked......


i tried setting the boolean variable true when the command button is clicked.....but the statements in the main project are executed before the command button is clicked......how do i rectify this problem???

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Hi,

In that case, u need to have a Global Boolean Varaiable, defined in .Bas with scope = Public

In ur module Give:

Public MyFlag As Boolean

In Command Click :
MyFlag =True

In the Procedure where u want to check give this in the Beginning:

If Not MyFlag Then Exit Sub.


REgards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

thanks veena,

But the problem is still not sorted out.....can u please tell me how to make the programme wait until the commandbutton_click event has been fired.....

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Hi Anud,

Can u please tell me what kind of program u r doing, (it makes easy for me to suggest).

u want to check in a single procedure or module..?

Regards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

actually i have created a login authentication form a dll where there is this command botton....
and i am i am including this dll in my project....i want only if the user
presses the command button ...then only the further procesing should be done.....

is there any way to make the project wait untill this commandbutton_click event is fired???

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Hi Anud,

Usually in such caeses, we Call First the Login Form, We dont write any code in "Sub Main", (which is the Default starting point). In Login Form Validate/Call Dll's/ Check number of Try's. If every thing is OK, the Call another procedure which will start the Connection To Main Program/Module/Populate Global Variables.

REgards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

sorry veena but i am not been able to understand you....

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Anu, You again!

See a dll works as a subprogram right?

in that you have a form with a command button and you want to know in your main program whether the user had clicked the command button in it. Ist it not.?

First tell me whether that form is visible with the command button and get back to me.

AV Manoharan
Junior Poster
166 posts since Jun 2007
Reputation Points: 10
Solved Threads: 9
 

yes sir the form along with the command button is visible...

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Hello Anud,

UR .dll Form Has Got COMMAND Button....?

Look, after compilation, u can only access .dll's Libraries/Procedures/Functions.
Visual Interface of Dll has got no meaning in the Calling Program.
Clearify...

Regards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

ya i created the showform function in the dll's class.....after calling the showform function i want the execution to proceed only after the command button has been clicked....

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Hi,

Then in .dll call the form in Modal:

Form1.Show 1

And in Command Click, Unload the Form


Regards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

its still not working.....i think its a case of making a thread wait.....can you please give an example wherein i can make a particular thread untill a particular event is fired....

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

hello anud18.. i think veena is right. if ur just doing a login forn... try call it then proceed to the process u want after the clicked event..
sometimes we need to change everything to fixed our problems!!!

but if u really want to put a code as it is...
and u want a wait until button is pressed??? try put a loop before the process need to be executed after the clicked and put a DOEVENTS .. use the variable to end the loop.. i hope it helps

vbCNEW
Light Poster
44 posts since Apr 2007
Reputation Points: 10
Solved Threads: 3
 

havnt been able to sort out the problem still...

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 
yes sir the form along with the command button is visible...


OK in that in sub command1_Click() you add

Unload Form2

and back in the main form immediately after

Form2.Show vbModal

Give this command

Form_load
command1.SetFocus (or any control in the main form)

remember a second form_load will duplicate all those AddItems
beware of that one.
For that for each control you have to removeitems in a loop that has been added on the initial state.

AV Manoharan
Junior Poster
166 posts since Jun 2007
Reputation Points: 10
Solved Threads: 9
 

not working sir

anud18
Junior Poster in Training
52 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You