Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleBuild a calculate with an interesting skin-like appearance
DescriptionThis example shows how to build a calculate with an interesting skin-like appearance in Visual Basic 6. It uses SetWindowRgn to restrict the form to fit an image. It uses transparent labels over buttons drawn on the image for calculator buttons.
Keywordscalculator, skin, SetWindowRgn
CategoriesGraphics, API, Controls
 
Thanks to Gamal Azim.

The form's surface contains an image of a calculator. The program makes a rounded rectangle region to fit and calls SetWindowRgn to make the form fit the picture. It uses transparent labels sitting over image areas to make the calculator buttons.

I don't think the calculator code works but this is an interesting example of making a "cheap skin" for an application.

 
' Initialization routine for the form.
' Set all variables to initial values.
Private Sub Form_Load()
    DecimalFlag = False
    NumOps = 0
    LastInput = "NONE"
    OpFlag = " "
    Label1 = Format(0, "0.")
    'Decimal.Caption = Format(0, ".")
    
Dim b As Long
Dim a
       'round rectangel
 b = CreateRoundRectRgn(10, 18, 216, 383, 45, 45)
 a = SetWindowRgn(hWnd, b, True)

Dim i As Integer

    For i = Label2.LBound To Label2.UBound
        Label2(i).Caption = ""
    Next i
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated