home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_refer
/
setuptxt
/
setup.txt
Wrap
Text File
|
1994-07-09
|
2KB
|
86 lines
Modification to SETUP1.MAK
~~~~~~~~~~~~~~~~~~~~~~~~~~
Have you wanted that Shaded Blue look that popular setup programs
have, for your VB application's setup code ? Well here is the answer
This function replaces the code in SETUP1.MAK in the
\VB\SETUPKIT\SETUP1 directory.
1) Replace the DrawBackground() function in the SETUP1.FRM with the
following code.
Sub DrawBackground ()
Dim i As Integer, hBrush As Integer
Dim r As RECT
Dim Dummy As Integer
Dim RectHght As Integer
Dim OldX As Integer
RectHght = SETUP1.ScaleHeight / (256 / 2)
r.Left = 0
r.Top = 0
r.right = SETUP1.ScaleWidth
r.bottom = RectHght
'Draw Small Rectangles of slightly different shades of the Color to get the
'Shaded Background Effect
For i = 0 To 255 Step 2
hBrush = CreateSolidBrush(RGB(0, 0, 255 - i))
Dummy = FillRect(SETUP1.hDC, r, hBrush)
Dummy = DeleteObject(hBrush)
r.Top = r.Top + RectHght
r.bottom = r.Top + RectHght
Next
'For the Title
SETUP1.FontSize = 40
SETUP1.ForeColor = &H0
SETUP1.CurrentX = SETUP1.ScaleWidth / 15
SETUP1.CurrentY = SETUP1.ScaleHeight / 15
OldX = SETUP1.CurrentX
Print APPNAME & " Setup";
SETUP1.CurrentX = OldX - SETUP1.ScaleWidth / 100
SETUP1.CurrentY = SETUP1.CurrentY - SETUP1.ScaleHeight / 100
SETUP1.ForeColor = &HFFFFFF
Print APPNAME & " Setup"
End Sub
2) Add the following lines to setup1.bas in the (general) (declarations)
Type RECT
Left As Integer
Top As Integer
right As Integer
bottom As Integer
End Type
'CreateSolidBrush
Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
'DeleteObject
Declare Function DeleteObject Lib "GDI" (ByVal hObject As Integer) As Integer
'FillRect
Declare Function FillRect Lib "User" (ByVal hDC As Integer, lpRect As RECT, ByVal hBrush As Integer) As Integer
Thats It!
If you have any problems or suggestions send me a mail at 73512,3675.
Vivek Venugopalan
73512,3675