borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (codes to use the scroLLBAR..??)Next Topic (VB.NET FREE PDF EBOOKS) New Topic New Poll Post Reply
how to solve the error "statement is not valid in a space?
please ,solution. PollPollPoll 1 100.00%
Total Votes 1 100%
AndreaVB Forum : VB.Net : error
Poster Message
muddassir
Level: Trainee

Registered: 23-08-2008
Posts: 2

icon error

  "I have declared namespaces as follows
Imports System.Drawing
Imports System.Drawing.Graphics
Imports system.Drawing.Drawing2D
Imports System.Windows.Forms.Control

"in the following code below first line shows an above error"

Public Sub FillRegionRectangle(ByVal e As PaintEventArgs)

        ' Create solid brush.
        Dim blueBrush As New SolidBrush(Color.Blue)

        ' Create rectangle for region.
        Dim fillRect As New Rectangle(100, 100, 200, 200)

        ' Create region for fill.
        Dim fillRegion As New [Region](fillRect)

        ' Fill region to screen.
        e.Graphics.FillRegion(blueBrush, fillRegion)
    End Sub

[Edited by muddassir on 24-08-2008 at 06:23 AM GMT]

23-08-2008 at 02:09 PM
View Profile Send Email to User Show All Posts | Quote Reply
WayneSpangler
Level: Trainee

Registered: 03-09-2008
Posts: 2
icon Re: error

The code works as it should. How did you call this sub? You used ByVal e As PaintEventArgs.
To test it i used the form paint event.
The vbcode tags did not work.
    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        FillRegionRectangle(e)
    End Sub


[Edited by WayneSpangler on 03-09-2008 at 06:19 PM GMT]

____________________________
I know enough to be dangerious.

03-09-2008 at 01:18 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : error
Previous Topic (codes to use the scroLLBAR..??)Next Topic (VB.NET FREE PDF EBOOKS) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder