Gradient draw using VB 6.0

Gradient

Public r1 As Integer, g1 As Integer, b1 As Integer
Public r2 As Integer, g2 As Integer, b2 As Integer

Public Sub DrawGradient(frm As Form)

Dim R As Integer, G As Integer, B As Integer
Dim i As Integer
frm.Cls
For i = 0 To 100
R = r1 – (((r1 – r2) / 100) * i)
G = g1 – (((g1 – g2) / 100) * i)
B = b1 – (((b1 – b2) / 100) * i)
frm.Line (0, (frm.ScaleHeight / 100) * i)-(frm.ScaleWidth, (frm.ScaleHeight / 100) * i), RGB(R, G, B)
Next i
End Sub
Public Sub WhiteBlue(frm As Form)
r1 = 255
g1 = 255
b1 = 255

r2 = 245
g2 = 200
b2 = 63

frm.Cls
Call DrawGradient(frm)
End Sub

Private Sub Form_Load()

Call WhiteBlue(frmStartUp)

End Sub

Advertisements

Menu Color Using VB 6.0

Untitled

‘——————–For Mnue Colour———————————————————————-
Private Const MIM_BACKGROUND As Long = &H2
Private Const MIM_APPLYTOSUBMENUS As Long = &H80000000

Private Type MENUINFO
cbSize As Long
fMask As Long
dwStyle As Long
cyMax As Long
hbrBack As Long
dwContextHelpID As Long
dwMenuData As Long
End Type

Private Declare Function DrawMenuBar Lib “user32″ _
(ByVal hWnd As Long) As Long

”’Private Declare Function GetSubMenu Lib “user32″ _
”'(ByVal hMenu As Long, ByVal nPos As Long) As Long
”’
”’Private Declare Function GetMenu Lib “user32″ _
”'(ByVal hWnd As Long) As Long

Private Declare Function SetMenuInfo Lib “user32” _
(ByVal hMenu As Long, _
mi As MENUINFO) As Long

Private Declare Function CreateSolidBrush Lib “gdi32” _
(ByVal crColor As Long) As Long
‘———————–Menu Color End———————————————————————

‘*********** Menu Colour **********
Private Sub ManuColour()
Dim mi As MENUINFO

With mi
.cbSize = Len(mi)

.fMask = MIM_BACKGROUND
.hbrBack = CreateSolidBrush(RGB(255, 255, 255))
SetMenuInfo GetMenu(Me.hWnd), mi ‘main menu bar
.fMask = MIM_BACKGROUND Or MIM_APPLYTOSUBMENUS
.hbrBack = CreateSolidBrush(RGB(139, 201, 242))
SetMenuInfo GetSubMenu(GetMenu(Me.hWnd), 0), mi ‘File menu (item 0)
.hbrBack = CreateSolidBrush(RGB(139, 201, 242))
SetMenuInfo GetSubMenu(GetMenu(Me.hWnd), 1), mi ‘Edit menu (item 1)
.hbrBack = CreateSolidBrush(RGB(139, 201, 242))
SetMenuInfo GetSubMenu(GetMenu(Me.hWnd), 2), mi ‘Select menu (item 2)
.hbrBack = CreateSolidBrush(RGB(139, 201, 242))
SetMenuInfo GetSubMenu(GetMenu(Me.hWnd), 3), mi ‘Select menu (item 2)
End With
DrawMenuBar Me.hWnd
End Sub

Show Crystal Report Using VB 6.0 and Access Database

 

Write this code in VB6.0

Private Sub Command1_Click()

CrystalReport1.WindowState = crptMaximized
CrystalReport1.DiscardSavedData = True
CrystalReport1.ReportFileName = “DatabasePath”
CrystalReport1.DataFiles(0) = “ReportPath”

If you want to pass value from vb6.0 to Crystal Report

‘CrystalReport1.Formulas(0) = “FDate='” & fromDate & “‘”

Optional If you use password protected database
‘CrystalReport1.Password = Chr$(10) & “sanjoy-pakiza”

Optional If you use Selection Formula
‘CrystalReport1.SelectionFormula = “{tblEmployeePersonalInfo.EID}=” &  1
CrystalReport1.WindowShowPrintBtn = True
CrystalReport1.WindowShowPrintSetupBtn = True
CrystalReport1.Action = 1

End Sub