Welcome to Dream.In.Code
Become a VB Expert!

Join 150,222 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,224 people online right now. Registration is fast and FREE... Join Now!




Calling a Sub

 
Reply to this topicStart new topic

Calling a Sub, How do you call a sub?

s_jsstevens
6 Dec, 2007 - 08:10 AM
Post #1

New D.I.C Head
*

Joined: 4 Dec, 2007
Posts: 10


My Contributions
I have a sub

CODE
    Private Sub drawme(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs)
        Dim img As Image
        img = System.Drawing.Image.FromFile("F:\Dads Work\Project Pictures\cross.bmp")
        e.Graphics.DrawImage(img, 0, 0, 25, 25)
    End Sub


but when I try to call it by typing

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

        drawme()

    End Sub


I get the error

argument not specified for parameter 'e' of 'private sub' drawme (sender as object, e as system.windows.forms.painteventarges)
*edit*
I have read the documentation and searched on google, but I have not found code that actually calls system.drawing
I have found code where they draw the picture first thing, but never found code where it was drawn when a button is pressed
*/edit*

*edit2*
I have tried doing drawme(sender, e) But i know that wont work because I am sending a mouse event arg to a
graphic arg
*/edit3*

thanks in advance for your help

This post has been edited by s_jsstevens: 6 Dec, 2007 - 08:50 AM
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Calling A Sub
6 Dec, 2007 - 08:14 AM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 7,166



Thanked: 78 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
Attached Image
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 05:51AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month