473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Do a call from a dynamically created button?

If I create a form dynamically, is there some way I can point to a dll
function/ sub when the dynamic button is pushed?

Or do something like this.

dim DynSub as string
DynSub = "DoItSub" <== Value will come from the dynamic loader.
Call DynSub.
-----------------------------------------------------------
Gary Kahrau - VP Technology
ka****@monair.com (W)
gk*****@optonline.net (H)
Stellex Monitor Aerospace Corp.
-----------------------------------------------------------
Nov 21 '05 #1
3 1148
Have a look at AddHandler, RemoveHandler and Handles.

L.

"Gary Kahrau" <gk*****@optonline.com> wrote in message
news:9g********************************@4ax.com...
If I create a form dynamically, is there some way I can point to a dll
function/ sub when the dynamic button is pushed?

Or do something like this.

dim DynSub as string
DynSub = "DoItSub" <== Value will come from the dynamic loader.
Call DynSub.
-----------------------------------------------------------
Gary Kahrau - VP Technology
ka****@monair.com (W)
gk*****@optonline.net (H)
Stellex Monitor Aerospace Corp.
-----------------------------------------------------------

Nov 21 '05 #2
You can use the function CallByName, or a Delegate function:

Sub Test()
CallByName Me, "DoItSub",... (other params)
End Sub

Sub DoItSub()
....
End Sub

- OR -

Private Delegate Sub DotItType()

Sub Test()
Dim d as New DoItType(AddressOf DoItSub)
d.Invoke()
End Sub

Sub DoItSub()
....
End Sub

HTH,
Jeremy

Nov 21 '05 #3
Gary,

Because of the fact that you have two answers, the one which I would have
given when there was none.

http://msdn.microsoft.com/library/de...rStatement.asp

I hope this helps?

Cor

"Gary Kahrau" <gk*****@optonline.com>
..
If I create a form dynamically, is there some way I can point to a dll
function/ sub when the dynamic button is pushed?

Or do something like this.

dim DynSub as string
DynSub = "DoItSub" <== Value will come from the dynamic loader.
Call DynSub.
-----------------------------------------------------------
Gary Kahrau - VP Technology
ka****@monair.com (W)
gk*****@optonline.net (H)
Stellex Monitor Aerospace Corp.
-----------------------------------------------------------

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Patrick Marti | last post by:
Is it possible to call a function from a ImageButton wich I create at runtime? That would be really interesting Many thanks for any suggest. Greetings Patrick Marti
2
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the...
2
by: djc | last post by:
On the page_load event I am querying a database and binding data to some text boxes, list boxes, and a repeater control. When the page loads it uses the value of one of the database fields (status)...
4
by: Zuel | last post by:
Hi Folks. So I have a small problem. My DoPostBack function is not writen to the HTML page nor are the asp:buttons calling the DoPostBack. My Goal is to create a totaly dynamic web page where...
6
by: TB | last post by:
Hi All: I have this page where a rows / cells are programmatically added to to table by pushing a button. The rows contain a textbox and a associated button. What I want to is to be able to...
7
by: rsaffy | last post by:
I am having trouble with my dynamically created button's event handling. I read that the buttons need to be recreated on every trip to the server, but how exactly do you do that when the datagrid...
6
by: Bjorn Sagbakken | last post by:
Hello In VS2005: I am adding buttons and textboxes dynamically into a table, that also dynamically expands. So far, so good, actually very nice. But I am having trouble starting the desired...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
1
by: deegeorge | last post by:
Hi, we have designed an online shopping website.in that we r displaying the online products for all the products we hve a buy button and details button which is created dynamically on click of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.