Results 1 to 1 of 1

Thread: VB6 Png Control,Simple transparent button control For VB6

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    VB6 Png Control,Simple transparent button control For VB6

    Simulate the control transparency effect: the developed custom control usercontrol sets a screenshot function as the base image, bitblt draws the background image on the form (or screenshots with other controls), and then draws the button image or text on it, you can use it usercontrol.cls is cleared (the base map remains unchanged)

    Private Sub Form_Load()
    Me.Picture = LoadPicture(App.Path & "\bg.jpg")
    'MyButton1(0).FilePath = "bt1a.png"
    'MyButton1(0).FileClick = "bt1b.png"
    End Sub

    Private Sub Form_Activate()

    If Me.Tag = "" Then
    Me.Tag = "a"

    Picture1.AutoRedraw = True
    'Picture1.Picture = LoadPicture(App.Path & "\bg.jpg")
    TransparentWithHdc Picture1.hwnd, Picture1.hDC

    MyButton1(0).CutBgImg
    MyButton1(0).ShowImg

    MyButton1(2).CutBgImg
    MyButton1(2).ShowImg

    End If
    End Sub
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by xiaoyao; Apr 9th, 2021 at 10:35 AM.

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