Results 1 to 2 of 2

Thread: hdc property from VB6

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    hdc property from VB6

    After conversion from VB6 to VB.NET the following code shows an error on frmMyMain.hdc.

    moPaintEffects.PaintTransparentStdPic(frmMyMain.hdc, frmMyMain.imgOKCircle(i).Left, frmMyMain.imgOKCircle(i).Top, frmMyMain.imgOKCircle(i).Width, frmMyMain.imgOKCircle(i).Height, ....etc..


    I know the hdc property is no longer used, but how might this code be changed for .NET?

  2. #2
    Lively Member
    Join Date
    Apr 2003
    Posts
    114
    VB.NET uses Graphics() in place of hDC for drawing.

    VB Code:
    1. Sub Test
    2.      dim g as Graphics=me.CreateGraphics()
    3.      g.DrawLine(....)
    4. End Sub

    If you want to use hDC still with certain functions, maybe try calling the GetDC() api passing in the handle of the object you want.

    VB Code:
    1. moPaintEffects.PaintTransparentStdPic(GetDC(CInt(frmMyMain.Handle.ToString)),...
    I can do all things with VB.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width