473,785 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Button1_Click() - place my own arguments?

Hi there. this is my codes in vb6:

private Action as integer

private sub button1_Click(i ndex as integer)
Action = Index
End Sub

private sub picture1_moused own(button as integer, shift as
integer, x as single, y as single)
if Action = 0 then
// draw a square here
end if

if Action = 1 then
// draw a circle
end if

if Action = 2 then
// draw a fillbox
end if
end sub

Yeah.. something like that...

Any help! How will you code that in c#?

In C#, i think it only can button1_click(o bject sender,
eventargs e)

Thanks.

Regards,
Chua Wen Ching
Nov 15 '05 #1
1 6557
I would assume that you are using one click event for several buttons in VB
and that each button generates a different "index". Here I would add
ValueButtons to a form (using the source I posted in your message titled
"VB6 Buton.Value") and place this "action/index" value in the Value member
of the button. Then associate each button with the same click event
handler. In the event handler you will have a parameter by the name of
"sender" (type object) which is the button that caused the click event. You
can then typecast this sender to a ValueButton and retrieve the Value
property which will contain your "Action/Index" value.

Of course this is all a best guess since I'm not exactly sure what you are
doing.

Brian Patterson

"Chua Wen Ching" <cw*@cwc.com> wrote in message
news:03******** *************** *****@phx.gbl.. .
Hi there. this is my codes in vb6:

private Action as integer

private sub button1_Click(i ndex as integer)
Action = Index
End Sub

private sub picture1_moused own(button as integer, shift as
integer, x as single, y as single)
if Action = 0 then
// draw a square here
end if

if Action = 1 then
// draw a circle
end if

if Action = 2 then
// draw a fillbox
end if
end sub

Yeah.. something like that...

Any help! How will you code that in c#?

In C#, i think it only can button1_click(o bject sender,
eventargs e)

Thanks.

Regards,
Chua Wen Ching

Nov 15 '05 #2

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

Similar topics

9
2439
by: Chuck Anderson | last post by:
I have a function with 7 inputs. The last three have default values. I want to call that function specifying the first four, skip two and then specify the last. I thought I could write this as : $retval = myfunction(arg1, arg2, arg3, arg4,,,arg7); .... but Php does not seem to want to let me do this. I get a parse
1
1412
by: tshad | last post by:
I had a project where I had some code in my Button1_Click procedure and copied it over to a new project (that had the same button name on it) and I couldn't figure out why the event never fired. I then double-clicked on the button and a new event opened which normally would have been Button1_Click, but in this case it was Button1_Click_1. I assume this was because I had manually put in the Button1_Click event. Why did it do that?
41
2584
by: Telmo Costa | last post by:
Hi. I have the following code: -------------------------------------- function Tunnel() { //arguments(???); } function Sum() { var sum = 0; for (i=0; i<arguments.length; i++) sum += arguments;
1
315
by: peter.mcclymont | last post by:
Hi There, Can you please help me write an in-place function in C++ for reversing a string. What is an in-place function? So what is a non-in-place function in that case to reverse a C++ string?
7
1940
by: sfeher | last post by:
Hi All, Is there a way to preserve the arguments across functions? I have: <script> function myFirstFunction() { // arguments = 'param1'
36
2729
by: Pacific Fox | last post by:
Hi all, haven't posted to this group before, but got an issue I can't work out... and hoping to get some help here ;-) I've got a base object that works fine with named arguments when called on it's own. However when I call the child object I get an error " has no properties (in firefox)." I simple test:
7
3224
by: VK | last post by:
I was getting this effect N times but each time I was in rush to just make it work, and later I coudn't recall anymore what was the original state I was working around. This time I nailed the bastard so posting it before I forgot again... By taking this minimum code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head>
2
12554
ADezii
by: ADezii | last post by:
When a call is made to a Sub or Function Procedure, you can supply Arguments in the exact order they appear in the Procedure's definition, or you can supply them in any position by name. To illustrate this point, I'll use a fictitious Function called fCalculateInterest() which accepts 3 Arguments (Currency, Single, and Long) and returns a value of type Currency. Public Function fCalculateInterest(curPrincipal As Currency, sngRate As Single,...
4
2024
by: Bali | last post by:
Hi I have an ascx control through which I am calling an aspx page using the following command. Page.ClientScript.RegisterStartupScript(GetType(), "test", "window.open(...)"); Initially I just added a label controls on the page and it opened up fine without any errors.
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9483
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9956
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.