Click here to Skip to main content
16,010,114 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Beginners code Pin
Vinaya Kumar6-Apr-07 6:37
Vinaya Kumar6-Apr-07 6:37 
Questiondetach database Pin
MohamedAdam6-Apr-07 2:37
MohamedAdam6-Apr-07 2:37 
AnswerRe: detach database Pin
Dave Kreskowiak6-Apr-07 4:37
mveDave Kreskowiak6-Apr-07 4:37 
QuestionQuestion from SSTAB Pin
Kumaran21cen6-Apr-07 1:45
Kumaran21cen6-Apr-07 1:45 
AnswerRe: Question from SSTAB Pin
Xandip6-Apr-07 21:46
Xandip6-Apr-07 21:46 
GeneralRe: Question from SSTAB Pin
Kumaran21cen10-Apr-07 19:29
Kumaran21cen10-Apr-07 19:29 
QuestionWhy I can draw this image? This is my code. Pin
astcws6-Apr-07 0:09
astcws6-Apr-07 0:09 
AnswerRe: Why I can draw this image? This is my code. Pin
Dave Kreskowiak6-Apr-07 4:33
mveDave Kreskowiak6-Apr-07 4:33 
astcws wrote:
Dim Lpoint As New Point(Lx * i, 0)


You're offsetting the X coordinate, not the Y. This is drawing each line of your image on the same line, just moved to the right, not down. It should be:
Dim Lpoint As New Point(0, Lx * i)

Also, you MUST Dispose() your Graphics objects after you're done using them. You'll eventually get OutOfMemory exceptions if you don't, and/or you're system will start doing crazy things. If you create the Graphics object, you have the dispose of it. The same is true for Brush's, Pen's, and just about any other object that has a Dispose method.
Public Function Yao(ByVal PorN As String, ByVal _Color As Color) As Bitmap
    Dim myBmp As New Bitmap(40, 5)
    Dim g As Graphics = Graphics.FromImage(myBmp)
    Dim Guabrush As SolidBrush = New SolidBrush(_Color)
    Select Case PorN
        Case "0"
            Dim rects As Rectangle() = {New Rectangle(0, 0, 18, 5), New Rectangle(22, 0, 18, 5)}
            g.FillRectangles(Guabrush, rects)
        Case "1"
            Dim rects As Rectangle() = {New Rectangle(0, 0, 40, 5)}
            g.FillRectangles(Guabrush, rects)
    End Select
    g.Dispose()
    Return myBmp
    End Function





Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: Why I can draw this image? This is my code. Pin
astcws6-Apr-07 5:28
astcws6-Apr-07 5:28 
QuestionLooping through rows in a datagridview Pin
steve_rm5-Apr-07 21:48
steve_rm5-Apr-07 21:48 
AnswerRe: Looping through rows in a datagridview Pin
Member 38798816-Apr-07 1:07
Member 38798816-Apr-07 1:07 
Questionvb.net - login on to site web Pin
seven.75-Apr-07 20:56
seven.75-Apr-07 20:56 
Questionconnection with web cam Pin
kripa215-Apr-07 19:22
kripa215-Apr-07 19:22 
AnswerRe: connection with web cam Pin
Dave Kreskowiak6-Apr-07 3:59
mveDave Kreskowiak6-Apr-07 3:59 
QuestionHelp!!! Declare a varied-length array of structures and the use of marshalling? Pin
peary5-Apr-07 18:17
peary5-Apr-07 18:17 
Questioncrystalreport problem Pin
kittipomgmd5-Apr-07 16:46
kittipomgmd5-Apr-07 16:46 
AnswerRe: crystalreport problem Pin
Member 38798816-Apr-07 1:02
Member 38798816-Apr-07 1:02 
QuestionStreamReader Writer problem Pin
f_soto5-Apr-07 15:31
f_soto5-Apr-07 15:31 
QuestionStreamReader Writer problem Pin
f_soto5-Apr-07 15:29
f_soto5-Apr-07 15:29 
AnswerRe: StreamReader Writer problem Pin
Dave Kreskowiak6-Apr-07 3:58
mveDave Kreskowiak6-Apr-07 3:58 
GeneralRe: StreamReader Writer problem Pin
f_soto6-Apr-07 18:38
f_soto6-Apr-07 18:38 
GeneralRe: StreamReader Writer problem Pin
Dave Kreskowiak7-Apr-07 5:43
mveDave Kreskowiak7-Apr-07 5:43 
GeneralRe: StreamReader Writer problem Pin
f_soto7-Apr-07 10:10
f_soto7-Apr-07 10:10 
GeneralRe: StreamReader Writer problem Pin
Dave Kreskowiak8-Apr-07 4:38
mveDave Kreskowiak8-Apr-07 4:38 
Questionw to Frozen DGV columns Pin
cstrader2325-Apr-07 15:13
cstrader2325-Apr-07 15:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.