Click here to Skip to main content
16,022,542 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi,

whenever I click a button on a form I succeeded to let my current form close and another form to open up through this code:

VB
Dim frmMy As HiPot
frmMy = New HiPot()
frmMy.show()


and in the form_load sub I used me.close(), but the problem is that I dont want to use any control button to do this action. So would anybody help me to find a way either to invoke the button action automatically or another way to do this.

Thanks in advance!
Posted
Updated 25-Jun-11 8:47am
v2
Comments
DaveAuld 25-Jun-11 15:20pm    
Don't quite follow which form you are trying to close from where and when ???

See comment to question, but as for the invoking a button click, you can using button_name.performClick()
 
Share this answer
 
Comments
nourbt 25-Jun-11 15:41pm    
I used this function but it did not work as i need the current form is not loading correctly
What do you mean with 'automatically'?
Probably you need a Timer[^] for the purpose.
 
Share this answer
 
Comments
nourbt 25-Jun-11 15:43pm    
I mean by automatically is that the form after loading and after applying the query it closes and other form is shown
Dr.Walt Fair, PE 25-Jun-11 17:19pm    
Why don't you just apply the query in the other form then?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900