Hi, I'm try to learn vb.net.
in delphi have .click method for click button by coding.
Can I do that with vb.net
Thank you very much. 12 65264
On Apr 10, 10:34 am, "Thammarat charoenchai." <apa...@gmail.com>
wrote:
Hi, I'm try to learn vb.net.
in delphi have .click method for click button by coding.
Can I do that with vb.net
Thank you very much.
myButton.PerformClick()
Thanks,
Seth Rowe
Call the method that handles the Click event of the button you want to click
and pass it sender and e.
If the function/sub that you want to call the button click from isn't
already being passed send As Object and e as System.EventArgs then you will
have to Dim/declare out your own.
Dim sender as Object
Dim e as System.EventArgs
btnAdd_Click( sender, e)
'This is the sub/method that gets called when the button is clicked
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
' Some code goes here
End Sub
'Here is an example that already is being passed sender and e As
System.EventArgs
Private Sub ContextMenuStrip1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ContextMenuStrip1.Click
'Some code
'Click the button
btnAdd_Click( sender, e)
End Sub
Hope that helps,
Chris
"Thammarat charoenchai." <ap****@gmail.comwrote in message
news:ua**************@TK2MSFTNGP04.phx.gbl...
Hi, I'm try to learn vb.net.
in delphi have .click method for click button by coding.
Can I do that with vb.net
Thank you very much.
This works perfectly - but what if you want to actually see the button
visually being pressed?
Cheers,
Johnny J.
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
On Apr 10, 10:34 am, "Thammarat charoenchai." <apa...@gmail.com>
wrote:
>Hi, I'm try to learn vb.net.
in delphi have .click method for click button by coding. Can I do that with vb.net
Thank you very much.
myButton.PerformClick()
Thanks,
Seth Rowe
That's much easier :o)
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
On Apr 10, 10:34 am, "Thammarat charoenchai." <apa...@gmail.com>
wrote:
>Hi, I'm try to learn vb.net.
in delphi have .click method for click button by coding. Can I do that with vb.net
Thank you very much.
myButton.PerformClick()
Thanks,
Seth Rowe
It's working, but have some problem. This is my code
Private Sub frmProducts_FormClosing(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles
MyBase.FormClosing
Dim ee As System.EventArgs
btnSave_ItemClick(sender, ee)
End Sub
when build project it's show
Warning 1 Variable 'ee' is used before it has been assigned a value. A
null reference exception could result at runtime.
C:\Project\HiStore\HiStore\frmProducts.vb 30 35 HiStore
What does it mean ?
Thank you very much
Try
Dim ee As System.EventArgs=New System.EventArgs
/Johnny J.
"Thammarat charoenchai." <ap****@gmail.comwrote in message
news:e2**************@TK2MSFTNGP03.phx.gbl...
It's working, but have some problem. This is my code
Private Sub frmProducts_FormClosing(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles
MyBase.FormClosing
Dim ee As System.EventArgs
btnSave_ItemClick(sender, ee)
End Sub
when build project it's show
Warning 1 Variable 'ee' is used before it has been assigned a value. A
null reference exception could result at runtime.
C:\Project\HiStore\HiStore\frmProducts.vb 30 35 HiStore
What does it mean ?
Thank you very much
Perfect!!
Thank you very much. :D
On Apr 10, 11:17 am, "Johnny J?rgensen" <j...@altcom.sewrote:
Try
Dim ee As System.EventArgs=New System.EventArgs
/Johnny J.
"Thammarat charoenchai." <apa...@gmail.comwrote in message
news:e2**************@TK2MSFTNGP03.phx.gbl...
It's working, but have some problem. This is my code
Private Sub frmProducts_FormClosing(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles
MyBase.FormClosing
Dim ee As System.EventArgs
btnSave_ItemClick(sender, ee)
End Sub
when build project it's show
Warning 1 Variable 'ee' is used before it has been assigned a value. A
null reference exception could result at runtime.
C:\Project\HiStore\HiStore\frmProducts.vb 30 35 HiStore
What does it mean ?
Thank you very much
Or he can just do btnSave_ItemClick(sender EventArgs.Empty) and avoid
the variable declaration.
Thanks,
Seth Rowe
This works perfectly - but what if you want to actually see the button
visually being pressed?
Good Question! Perhaps you could do this by passing the appropriate
windows messages to the button via the windows api, but I don't know
if that would work. If you need this behavior you will probably need
to do a userdrawn button and just draw the "pressed" image before you
call the PerformClick method.
Thanks,
Seth Rowe
On Apr 10, 11:04 am, "Johnny Jörgensen" <j...@altcom.sewrote:
This works perfectly - but what if you want to actually see the button
visually being pressed?
Cheers,
Johnny J.
"rowe_newsgroups" <rowe_em...@yahoo.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
On Apr 10, 10:34 am, "Thammarat charoenchai." <apa...@gmail.com>
wrote:
Hi, I'm try to learn vb.net.
in delphi have .click method for click button by coding.
Can I do that with vb.net
Thank you very much.
myButton.PerformClick()
Thanks,
Seth Rowe
"Johnny Jörgensen" <jo**@altcom.seschrieb:
This works perfectly - but what if you want to actually see the button
visually being pressed?
<URL:http://dotnet.mvps.org/dotnet/code/controls/#PressButton>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
"Thammarat charoenchai." <ap****@gmail.comschrieb:
It's working, but have some problem. This is my code
Private Sub frmProducts_FormClosing(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles
MyBase.FormClosing
Dim ee As System.EventArgs
btnSave_ItemClick(sender, ee)
='btnSave_ItemClick(sender, EventArgs.Empty)'.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
On Apr 10, 12:22 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrote:
"Johnny Jörgensen" <j...@altcom.seschrieb:
This works perfectly - but what if you want to actually see the button
visually being pressed?
<URL:http://dotnet.mvps.org/dotnet/code/controls/#PressButton>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Thanks for the link Herfried, I was just going through pinvoke.net
trying to find the appropriate message values - now I have to get back
to work :-(
Thanks,
Seth Rowe This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: yfng |
last post by:
In a web form, I want the user clicks on one button and this button will
trigger another button/link which will open a new browser window? How to do
that? Is there any method like...
|
by: [Yosi] |
last post by:
I search solution for a little bit strange problem , I working on an
application which includes a button.
Click on this button will create number of threads each one execute deferent
executable...
|
by: Steve |
last post by:
Hi,
Is it possible to make hitting the enter key in an ASP
textbox run the code behind an ASP button on a form?
I have a search page which users tend to type in the
query then just hit enter...
|
by: Wang |
last post by:
Here is the code for a webcontrol, quite simple:
-------------------------------------------------------------------------------------------------------------
<%@ Control Language="c#"...
|
by: radders |
last post by:
Hi guys,
What I'd like to do is place three edit boxes with three static text labels on a click button. This would let the user input RGB values to the three edit boxes and then click the...
|
by: eddie69 |
last post by:
Hi,
Newbie question here:
I am creating an application in VB Studio 2005 which reads the status of an USB PIR Motion sensor.
So far, I have managed to get the application to read the motion...
|
by: nittin14 |
last post by:
hi guys i m a beginner in Asp.net
can u tell me that how to open page in new window after click button as well as i want to pass some data from this page.
thanks
|
by: laziers |
last post by:
Hi,
anyone know how to write a single-cilick button?
I use this:
<asp:button id="ButtonAdd" runat="server" text="Anuluj"
onclick="Click_ButtonAdd" />
if ( !isPostBack){...
|
by: abdulazees |
last post by:
when click button i want to print autometicaly reportveiwer data, i not need to show reportviewer.
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |