-
Sep 13th, 2008, 02:24 PM
#1
Thread Starter
Hyperactive Member
[TUTORIAL] How To: Customize TitleBar!
Here is my tutorial on how to customize your top bar!
Requirements:
Visual Basic 2008
DotNetBar
Slight Programming Skill!
1) Open A new Visual Basic Project and call it whatever you want!
2) Go To the DotNetBar tab in the Tools Menu
3) Place A Bar down
4) Right click the bar and click properties
5) Once your at properties look for dock
6) Click it and select the Top Button.
7) Click on the Bar and a Arrow should appear click it and Click Add Button and name it Exit
8) Right click The button and Click View code
9) Type in
10) If you want Add another button and name it Minimize
11) Right Click and view the code of that!
12) Type in
Code:
Me.WindowState = FormWindowState.Minimized
13) If you want create another button and call it Maximize
14) View the code the type in
Code:
Me.WindowState = FormWindowState.Maximized
15) Click on the Bar and click View Code Add this to Public Class Form1
Code:
' Tracks whether the form is in drag mode. If it is, mouse movements
' over the picturebox will be translated into form movements.
Dim Dragging As Boolean
' Stores the offset where the picturebox is clicked.
Dim PointClicked As Point
16) Then just add this WHOLE code to your project
Code:
Private Sub Bar1_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles Bar1.MouseDown
If e.Button = MouseButtons.Left Then
Dragging = True
PointClicked = New Point(e.X, e.Y)
Else
Dragging = False
End If
End Sub
Private Sub Bar1_MouseMove(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles Bar1.MouseMove
If Dragging Then
Dim PointMoveTo As Point
' Find the current mouse position in screen coordinates.
PointMoveTo = Me.PointToScreen(New Point(e.X, e.Y))
' Compensate for the position the control was clicked.
PointMoveTo.Offset(-PointClicked.X, -PointClicked.Y - (Me.Height - Me.ClientRectangle.Height))
' Move the form.
Me.Location = PointMoveTo
End If
End Sub
Private Sub Bar1_MouseUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles Bar1.MouseUp
Dragging = False
End Sub
And thats all now you should have a cool looking Titlebar.
Pictures here: http://www.vbforums.com/showpost.php...72&postcount=6
Thanks to .Paul. for the great info on how to move the Form without the Titlebar
Last edited by VB6Learner; Sep 13th, 2008 at 08:23 PM.
-
Sep 13th, 2008, 02:29 PM
#2
Frenzied Member
Re: [TUTORIAL] How To: Customize TitleBar!
Wrong subforum mate! This belongs in the CodeBank.
Please rate helpful ppl's posts. It's the best 'thank you' you can give
-
Sep 13th, 2008, 02:30 PM
#3
Thread Starter
Hyperactive Member
Re: [TUTORIAL] How To: Customize TitleBar!
Ya sorry I never knew where to put this! I looked for something like tutorial couldent find it. So I put it here. Well what do you think of it any ways?
-
Sep 13th, 2008, 02:40 PM
#4
Re: [TUTORIAL] How To: Customize TitleBar!
can you post a screenshot?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 13th, 2008, 07:26 PM
#5
Thread Starter
Hyperactive Member
Re: [TUTORIAL] How To: Customize TitleBar!
Ya sure I will later!
-
Sep 13th, 2008, 08:06 PM
#6
Thread Starter
Hyperactive Member
-
Sep 13th, 2008, 08:22 PM
#7
Thread Starter
Hyperactive Member
Re: [TUTORIAL] How To: Customize TitleBar!
Oh and for those that wanted the Normal Window Button here is the code:
Code:
Me.WindowState = FormWindowState.Normal
-
Sep 14th, 2008, 05:26 AM
#8
Frenzied Member
Re: [TUTORIAL] How To: Customize TitleBar!
Nice... IMHO, you should PM a mod to move the thread to the CodeBank so ppl can make the most out of it.
Please rate helpful ppl's posts. It's the best 'thank you' you can give
-
Sep 14th, 2008, 11:49 AM
#9
Thread Starter
Hyperactive Member
Re: [TUTORIAL] How To: Customize TitleBar!
Ya sure! Who should I PM?
-
Sep 15th, 2008, 06:19 AM
#10
Frenzied Member
Re: [TUTORIAL] How To: Customize TitleBar!
Please rate helpful ppl's posts. It's the best 'thank you' you can give
-
Sep 15th, 2008, 09:49 AM
#11
Lively Member
Re: [TUTORIAL] How To: Customize TitleBar!
does this work in the express edition?
-
Sep 15th, 2008, 01:07 PM
#12
Re: [TUTORIAL] How To: Customize TitleBar!
Originally Posted by astroanu2004
does this work in the express edition?
Yes, the express edition can handle custom controls like the dotnetbar
-
Sep 17th, 2008, 07:38 PM
#13
Thread Starter
Hyperactive Member
Re: [TUTORIAL] How To: Customize TitleBar!
Can this topic be moved to codebanks?
-
Sep 18th, 2008, 12:29 PM
#14
Frenzied Member
Re: [TUTORIAL] How To: Customize TitleBar!
I totally don't understand what this tutorial is about. The screenshot of your "cool" titlebar looks like nothing more than the standard VS toolbar component with buttons. So why would you want buttons on your titlebar as you show it? You already have the standard buttons in the upper right corner for minimizing, maximizing & closing.
-
Sep 18th, 2008, 01:36 PM
#15
Re: [TUTORIAL] How To: Customize TitleBar!
My guess is it is supposed to replace the title, not complement it.
I also personally hate applications that customize the title bar at all (like google chrome). It usually takes away standard functionality because they never fully replace all the features with comparable ones, only the most basic or common features. Does your title bar give you standard title bar options when you right click it? What about my ultramon multi monitor app buttons that it automatically inserts extra functionality into any standard windows titlebar? That is probably the biggest reason I hate skinned apps/custom titlebars, but I will concede not a huge number of people run such a monitor setup.
I will move to codebank.
-
Sep 18th, 2008, 09:57 PM
#16
Re: [TUTORIAL] How To: Customize TitleBar!
Originally Posted by kleinma
My guess is it is supposed to replace the title, not complement it.
I also personally hate applications that customize the title bar at all (like google chrome). It usually takes away standard functionality because they never fully replace all the features with comparable ones, only the most basic or common features. Does your title bar give you standard title bar options when you right click it? What about my ultramon multi monitor app buttons that it automatically inserts extra functionality into any standard windows titlebar? That is probably the biggest reason I hate skinned apps/custom titlebars, but I will concede not a huge number of people run such a monitor setup.
I will move to codebank.
You wrote the UltraMon application?!? I am playing with a trial version of that just now, and so far I am finding it very useful!!! Well done!!!!
-
Sep 19th, 2008, 09:47 AM
#17
Re: [TUTORIAL] How To: Customize TitleBar!
lol, no sorry if I gave that impression.. I just meant I own a copy of it...
I have several apps that just don't work with it because they use customized title bars or skinned windows.
-
Sep 19th, 2008, 09:54 AM
#18
Re: [TUTORIAL] How To: Customize TitleBar!
Ha ha!! I was away to be giving you lot of credit there!! I know what you mean though, certain apps don't like UltraMon, or the other way round, and you lose the ability to switch monitors quickly which is a bit annoying.
-
Sep 19th, 2008, 10:16 AM
#19
Re: [TUTORIAL] How To: Customize TitleBar!
Originally Posted by kleinma
lol, no sorry if I gave that impression.. I just meant I own a copy of it...
I have several apps that just don't work with it because they use customized title bars or skinned windows.
Like WindowsMediaPlayer and Office 2007? I hate those skins, MS ****ed the poodle on those programs.
-
Sep 19th, 2008, 10:23 AM
#20
Re: [TUTORIAL] How To: Customize TitleBar!
Originally Posted by JuggaloBrotha
Like WindowsMediaPlayer and Office 2007? I hate those skins, MS ****ed the poodle on those programs.
nope they work just fine, and they both have normal title bars...
So I am not sure what you mean...
I also don't consider either of those applications to be "skinned" with maybe the exception of the new office thing in the upper left corner, but I can still double click the upperleft corner to close the app.
-
Sep 26th, 2008, 12:30 AM
#21
Re: [TUTORIAL] How To: Customize TitleBar!
It should be noted that there's a difference between customising the existing title bar on a form, which can be done, and removing it and replacing it with a fake one. If you customise the real title bar then any windows functions that rely on the real title bar will work. There's no need to worry about implementing your own drag and drop or creating your own buttons. You may have seen that Office 2007 apps sometimes momentarily revert to the standard title bar under heavy system load. That's because the system hasn't had time to redraw the title bar using the app's specs, so the standard one gets drawn instead.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|