Hi, All,
I create button in the code ( Dim Button as new Button), not using button
web component (means not drap button and drop it ont he webform), after that
I try to use button_click event, it is not work, anyone can tell how to use
button click event ?
Thanks in advance,
Martin 7 6623
On May 24, 12:53 pm, martin1 <mart...@discussions.microsoft.com>
wrote:
Hi, All,
I create button in the code ( Dim Button as new Button), not using button
web component (means not drap button and drop it ont he webform), after that
I try to use button_click event, it is not work, anyone can tell how to use
button click event ?
Thanks in advance,
Martin
AddHandler
Thanks,
Seth Rowe
Hi, Seth Rowe,
could you give sample on how to use addhandler,
Thanks,
martin
"rowe_newsgroups" wrote:
On May 24, 12:53 pm, martin1 <mart...@discussions.microsoft.com>
wrote:
Hi, All,
I create button in the code ( Dim Button as new Button), not using button
web component (means not drap button and drop it ont he webform), after that
I try to use button_click event, it is not work, anyone can tell how to use
button click event ?
Thanks in advance,
Martin
AddHandler
Thanks,
Seth Rowe
On May 24, 1:36 pm, martin1 <mart...@discussions.microsoft.comwrote:
Hi, Seth Rowe,
could you give sample on how to use addhandler,
Thanks,
martin
"rowe_newsgroups" wrote:
On May 24, 12:53 pm, martin1 <mart...@discussions.microsoft.com>
wrote:
Hi, All,
I create button in the code ( Dim Button as new Button), not using button
web component (means not drap button and drop it ont he webform), after that
I try to use button_click event, it is not work, anyone can tell how to use
button click event ?
Thanks in advance,
Martin
AddHandler
Thanks,
Seth Rowe
Private Sub Form_Load(sender As Object, e As EventArgs)
Dim btn as new Button()
AddHandler btn.Click, AddressOf Button_Click
End Sub
Private Sub Button_Click(sender As Object, e As EventArgs)
' Do something useful
End Sub
Thanks,
Seth Rowe
Thank you! Seth Rowe
What I want to do is let user click each button to pop up message which is
related to StatusDesc field of Sysstat Table, the message is dynamic. The
problem (look at code below) is StatusDesc message is overwritten by next
loop, so how to keep statusDesc message for each button?
The Code like:
---------------------------------------------------
Pub Class _Default
Dim StatusDesc As String
Private Sub Form_Load(sender As Object, e As EventArgs)
For Each row In dtSysstat.Rows ' loop each record of sysstat table
Dim button As New Button ' create button for each row
btnText = Trim(row.Item("ButtonName")) ' get ButtonName
from table
StatusDesc = Trim(row.Item("StatusDesc").ToString) 'get
StatusDesc
button.Text = btnText
panel.Controls.Add(button)
' add click event to button
AddHandler button.Click, AddressOf Button_click
End Sub
Private Sub Button_Click(sender As Object, e As EventArgs)
MsgBox(StatusDesc)
End Sub
End Class
------------------------------------------------
Thank you again,
Martin
"rowe_newsgroups" wrote:
On May 24, 1:36 pm, martin1 <mart...@discussions.microsoft.comwrote:
Hi, Seth Rowe,
could you give sample on how to use addhandler,
Thanks,
martin
"rowe_newsgroups" wrote:
On May 24, 12:53 pm, martin1 <mart...@discussions.microsoft.com>
wrote:
Hi, All,
I create button in the code ( Dim Button as new Button), not using button
web component (means not drap button and drop it ont he webform), after that
I try to use button_click event, it is not work, anyone can tell how to use
button click event ?
Thanks in advance,
Martin
AddHandler
Thanks,
Seth Rowe
Private Sub Form_Load(sender As Object, e As EventArgs)
Dim btn as new Button()
AddHandler btn.Click, AddressOf Button_Click
End Sub
Private Sub Button_Click(sender As Object, e As EventArgs)
' Do something useful
End Sub
Thanks,
Seth Rowe
"martin1" <ma*****@discussions.microsoft.comwrote in message
news:09**********************************@microsof t.com...
Thank you! Seth Rowe
What I want to do is let user click each button to pop up message which is
related to StatusDesc field of Sysstat Table, the message is dynamic. The
problem (look at code below) is StatusDesc message is overwritten by next
loop, so how to keep statusDesc message for each button?
The Code like:
---------------------------------------------------
Pub Class _Default
Dim StatusDesc As String
Private Sub Form_Load(sender As Object, e As EventArgs)
For Each row In dtSysstat.Rows ' loop each record of sysstat table
Dim button As New Button ' create button for each row
btnText = Trim(row.Item("ButtonName")) ' get ButtonName
from table
StatusDesc = Trim(row.Item("StatusDesc").ToString) 'get
StatusDesc
button.Text = btnText
panel.Controls.Add(button)
' add click event to button
AddHandler button.Click, AddressOf Button_click
End Sub
Private Sub Button_Click(sender As Object, e As EventArgs)
MsgBox(StatusDesc)
End Sub
End Class
------------------------------------------------
Thank you again,
Martin
"rowe_newsgroups" wrote:
>On May 24, 1:36 pm, martin1 <mart...@discussions.microsoft.comwrote:
Hi, Seth Rowe,
could you give sample on how to use addhandler,
Thanks,
martin
"rowe_newsgroups" wrote:
On May 24, 12:53 pm, martin1 <mart...@discussions.microsoft.com>
wrote:
Hi, All,
I create button in the code ( Dim Button as new Button), not using
button
web component (means not drap button and drop it ont he webform),
after that
I try to use button_click event, it is not work, anyone can tell
how to use
button click event ?
Thanks in advance,
Martin
AddHandler
Thanks,
Seth Rowe
Private Sub Form_Load(sender As Object, e As EventArgs) Dim btn as new Button() AddHandler btn.Click, AddressOf Button_Click End Sub
Private Sub Button_Click(sender As Object, e As EventArgs) ' Do something useful End Sub
Thanks,
Seth Rowe
When you create the button, set btn.tag = StatusDesc. Then when you handle
the click event you can cast the sender to a button and retrieve the tag as
the description.
Hope this helps
Lloyd Sheen
Hi, Lloyd Sheen,
it works, Thank you so much,
Martin
"Lloyd Sheen" wrote:
>
"martin1" <ma*****@discussions.microsoft.comwrote in message
news:09**********************************@microsof t.com...
Thank you! Seth Rowe
What I want to do is let user click each button to pop up message which is
related to StatusDesc field of Sysstat Table, the message is dynamic. The
problem (look at code below) is StatusDesc message is overwritten by next
loop, so how to keep statusDesc message for each button?
The Code like:
---------------------------------------------------
Pub Class _Default
Dim StatusDesc As String
Private Sub Form_Load(sender As Object, e As EventArgs)
For Each row In dtSysstat.Rows ' loop each record of sysstat table
Dim button As New Button ' create button for each row
btnText = Trim(row.Item("ButtonName")) ' get ButtonName
from table
StatusDesc = Trim(row.Item("StatusDesc").ToString) 'get
StatusDesc
button.Text = btnText
panel.Controls.Add(button)
' add click event to button
AddHandler button.Click, AddressOf Button_click
End Sub
Private Sub Button_Click(sender As Object, e As EventArgs)
MsgBox(StatusDesc)
End Sub
End Class
------------------------------------------------
Thank you again,
Martin
"rowe_newsgroups" wrote:
On May 24, 1:36 pm, martin1 <mart...@discussions.microsoft.comwrote:
Hi, Seth Rowe,
could you give sample on how to use addhandler,
Thanks,
martin
"rowe_newsgroups" wrote:
On May 24, 12:53 pm, martin1 <mart...@discussions.microsoft.com>
wrote:
Hi, All,
I create button in the code ( Dim Button as new Button), not using
button
web component (means not drap button and drop it ont he webform),
after that
I try to use button_click event, it is not work, anyone can tell
how to use
button click event ?
Thanks in advance,
Martin
AddHandler
Thanks,
Seth Rowe
Private Sub Form_Load(sender As Object, e As EventArgs)
Dim btn as new Button()
AddHandler btn.Click, AddressOf Button_Click
End Sub
Private Sub Button_Click(sender As Object, e As EventArgs)
' Do something useful
End Sub
Thanks,
Seth Rowe
When you create the button, set btn.tag = StatusDesc. Then when you handle
the click event you can cast the sender to a button and retrieve the tag as
the description.
Hope this helps
Lloyd Sheen
Hi,
Is there any way we can use mouse-over-button event instead button-click
event? What i want to do is instead let user click button to pop up message i
let user put mouse over button and then auto-pop up message?
Thanks,
Martin
"Lloyd Sheen" wrote:
>
"martin1" <ma*****@discussions.microsoft.comwrote in message
news:09**********************************@microsof t.com...
Thank you! Seth Rowe
What I want to do is let user click each button to pop up message which is
related to StatusDesc field of Sysstat Table, the message is dynamic. The
problem (look at code below) is StatusDesc message is overwritten by next
loop, so how to keep statusDesc message for each button?
The Code like:
---------------------------------------------------
Pub Class _Default
Dim StatusDesc As String
Private Sub Form_Load(sender As Object, e As EventArgs)
For Each row In dtSysstat.Rows ' loop each record of sysstat table
Dim button As New Button ' create button for each row
btnText = Trim(row.Item("ButtonName")) ' get ButtonName
from table
StatusDesc = Trim(row.Item("StatusDesc").ToString) 'get
StatusDesc
button.Text = btnText
panel.Controls.Add(button)
' add click event to button
AddHandler button.Click, AddressOf Button_click
End Sub
Private Sub Button_Click(sender As Object, e As EventArgs)
MsgBox(StatusDesc)
End Sub
End Class
------------------------------------------------
Thank you again,
Martin
"rowe_newsgroups" wrote:
On May 24, 1:36 pm, martin1 <mart...@discussions.microsoft.comwrote:
Hi, Seth Rowe,
could you give sample on how to use addhandler,
Thanks,
martin
"rowe_newsgroups" wrote:
On May 24, 12:53 pm, martin1 <mart...@discussions.microsoft.com>
wrote:
Hi, All,
I create button in the code ( Dim Button as new Button), not using
button
web component (means not drap button and drop it ont he webform),
after that
I try to use button_click event, it is not work, anyone can tell
how to use
button click event ?
Thanks in advance,
Martin
AddHandler
Thanks,
Seth Rowe
Private Sub Form_Load(sender As Object, e As EventArgs)
Dim btn as new Button()
AddHandler btn.Click, AddressOf Button_Click
End Sub
Private Sub Button_Click(sender As Object, e As EventArgs)
' Do something useful
End Sub
Thanks,
Seth Rowe
When you create the button, set btn.tag = StatusDesc. Then when you handle
the click event you can cast the sender to a button and retrieve the tag as
the description.
Hope this helps
Lloyd Sheen This discussion thread is closed Replies have been disabled for this discussion. Similar topics
4 posts
views
Thread by yfng |
last post: by
|
2 posts
views
Thread by Liqun Xu |
last post: by
|
6 posts
views
Thread by Michael Johnson Jr. |
last post: by
|
4 posts
views
Thread by Mark Lingen |
last post: by
|
11 posts
views
Thread by CW |
last post: by
|
3 posts
views
Thread by Imran Aziz |
last post: by
|
7 posts
views
Thread by MgGuigg |
last post: by
|
15 posts
views
Thread by Oleg Subachev |
last post: by
|
3 posts
views
Thread by GauravGupta |
last post: by
| | | | | | | | | | |