Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This application will create a customized title ba...
Author:
N.Indrasena Reddy
E-mail:
Click to e-mail author
Submitted:
2/3/2001
Version:
VB5
Compatibility:
VB5, VB6
Category:
Forms
Views:
13053
This application will create a customized title bar for people got bored of seeing the regular window title bar background.
Declarations:
'none
Code:
This Code to work u got to have 3 picture boxes,one label, one command button. Set the Form's Border style property to None. Set the Picture Boxes Back Color property to the Label's BackColor property. Set the Label and Picture Boxes visible property to false at design time. Private Sub Command1_Click() 'This Will accept caption for the titlebar Dim s As String s = InputBox("Enter the Caption for Title Bar", "Title Bar Caption") If s Like "" Then Else Label1.Caption = s End If Label1.Visible = True Label1.Left = Me.ScaleLeft Label1.Top = Me.ScaleTop Label1.Width = Me.ScaleWidth Picture1.Visible = True Picture1.Top = Me.ScaleTop End Sub Private Sub Form_Resize() 'Used for moving the Picture Boxes to the respective positions when the form is resized Dim x, y, y1, y2, diff, diff1, diff2 As Integer x = Me.ScaleWidth y = Picture1.Width y1 = Picture2.Width y2 = Picture3.Width diff = (x - y) diff1 = (x - y) - y1 diff2 = (x - y) - (y1) - (y2) Picture1.Move diff Picture2.Move diff1 Picture3.Move diff2 Label1.Visible = True Label1.Left = Me.ScaleLeft Label1.Top = Me.ScaleTop Label1.Width = Me.ScaleWidth Picture1.Visible = True Picture1.Top = Me.ScaleTop Picture2.Visible = True Picture2.Top = Me.ScaleTop Picture3.Visible = True Picture3.Top = Me.ScaleTop End Sub Private Sub Picture1_Click() Unload Me End Sub Private Sub Picture2_Click() Static x As Integer Dim pw As Integer Dim y As Integer x = x + 3 y = (x Mod 2) pw = Picture2.Width If y <> 0 Then Me.WindowState = 2 Picture2.Width = pw / 2 End If If y = 0 Then Me.WindowState = 0 Picture2.Width = pw * 2 End If End Sub Private Sub Picture3_Click() Me.WindowState = 1 End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement