473,287 Members | 1,964 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,287 software developers and data experts.

ASP/VB.NET? How Pass Parameter PaintEventArgs

Hi Buddy,

see my small example,

Public Sub myPaint(ByVal e As System.Windows.Forms.PaintEventArgs)

e.Graphics.DrawString(" MichaelAyvazyan", Font, New SolidBrush(Color.Beige), 100, 100)

End Sub

Here one userdefined Method,
I need to call this method in Button Cliclk event,
Means when i click button the string "MichaelAyvazyan" display the position
Now my doubt is , How can i pass parameter "e" in button click Event

In button click event

Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

myPaint( ? )

End Sub

Any Idea
Jan 4 '08 #1
3 5249
RedSon
5,000 Expert 4TB
Anyone? seems like a web thing. Moved it from mobile.
Jan 10 '08 #2
Plater
7,872 Expert 4TB
This is windows forms code.

The myPaint function is an event handler function and should be set as the event handler for the Paint event on the desired control.
Then to call it, you would say:
mycontrol.Refresh()

You should not call eventhandlers directly.
Jan 10 '08 #3
i am fail at coding in event handler.
so if u can, let me see how to code above event handler problem.
Because i also have above problem.
i make event handler but it is also need to send PainteventArgs.
how can i do?
Jan 30 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Yarik | last post by:
Hello there! I am working with MS SQL Server 2000. I have a table function that takes an integer parameter and returns a table, and I can successfully use it like this (passing a literal as a...
2
by: DraguVaso | last post by:
Hi, To get faster performance of my DataGrid during scrolling I wanted to build a timer in the Paint-event that waited some milli-seconds to Paint and cancelled the method in case it received a...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
1
by: Dion Heskett | last post by:
How can I pass a Class as a parameter to in a method ? i.e. Private myMethod( string pram1, Classobject as pram2) { Classobject.DataSource = reader; Classobject.DataBind(); }
0
by: Martin | last post by:
I have Panel embedded in a Form. The panel has a PaintEventHandler to catch PaintEvents. When a PaintEvent occurs a new Thread which moves a Ellipse should be created. The Code: private void...
0
by: Kent Johnson | last post by:
We have a chat client written in C# that occasionally throws the following exceptions for our users (typically after prolonged use)... ArgumentException: Invalid parameter used. at...
9
by: Jay Douglas | last post by:
Hello, I am needing to pass a class object (this) by reference to a method in a different class. When I do the following code I get the error (Cannot pass '<this>' as a ref or out argument because...
1
by: eBob.com | last post by:
I have some code which is trying to determine where text will wrap in a custom text box (which Inherits from Control). It determines the number of characters which will fit in the first line, but...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.