Application Bar Update - AutoHide
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
Hello Guys,
OK I have another update for you. This one is to have an Auto-Hide feature where the bar hides off screen when its inactive for 5 seconds and can be brought back on screen by moving your mouse over it.
Heres how to add it to the code. Its a good idea to first backup your original code just incase something goes wrong. Are you ready? ok lets start...
First things first. You need to add a 'Timer' control to the form and set the 'Interval' Property to what-ever you want, in this case ive set it to 5 seconds (5000).
Now you need to add a new menu to the 'ContextMenuStrip' so click on it then when the menu appears click on box which says "Type Here" and enter 'Auto Hide'. Once you have done that you need to set its 'CheckonClick' propertie to 'True' and thats all you need to do for that. Now comes the code part.
So find and add the following:
Find:
And that should be it. Congratulations you now have an Auto-Hide feature!. Compile > Save and Run your new Application Bar to see the results.
Download this update: If you have any problems let me know and I will help you.
Thank you and stay tuned for more updates in the future
OK I have another update for you. This one is to have an Auto-Hide feature where the bar hides off screen when its inactive for 5 seconds and can be brought back on screen by moving your mouse over it.
Heres how to add it to the code. Its a good idea to first backup your original code just incase something goes wrong. Are you ready? ok lets start...
First things first. You need to add a 'Timer' control to the form and set the 'Interval' Property to what-ever you want, in this case ive set it to 5 seconds (5000).
Now you need to add a new menu to the 'ContextMenuStrip' so click on it then when the menu appears click on box which says "Type Here" and enter 'Auto Hide'. Once you have done that you need to set its 'CheckonClick' propertie to 'True' and thats all you need to do for that. Now comes the code part.
So find and add the following:
Find:
Code: Select all
Underneath it Add:
Public Class Form1
Public rowz = 20
Public horv
Code: Select all
Find:
Public hider = 0
Code: Select all
Just before 'End Sub' add 'hider = 1' So it looks like this:Private Sub Lab_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs)
CType(sender, PictureBox).Size = New Size(40, 40)
If horv = "top" Then
CType(sender, PictureBox).Location = New Point(sender.Location.X - 5, sender.Location.Y)
ElseIf horv = "bottom" Then
CType(sender, PictureBox).Location = New Point(sender.Location.X - 5, sender.Location.Y)
ElseIf horv = "right" Then
CType(sender, PictureBox).Location = New Point(sender.Location.X - 5, sender.Location.Y)
Else
CType(sender, PictureBox).Location = New Point(sender.Location.X + 5, sender.Location.Y)
End If
End Sub
Code: Select all
Now head right down to the very last line of your code and just above 'End Class' add this new code:Private Sub Lab_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs)
CType(sender, PictureBox).Size = New Size(40, 40)
If horv = "top" Then
CType(sender, PictureBox).Location = New Point(sender.Location.X - 5, sender.Location.Y)
ElseIf horv = "bottom" Then
CType(sender, PictureBox).Location = New Point(sender.Location.X - 5, sender.Location.Y)
ElseIf horv = "right" Then
CType(sender, PictureBox).Location = New Point(sender.Location.X - 5, sender.Location.Y)
Else
CType(sender, PictureBox).Location = New Point(sender.Location.X + 5, sender.Location.Y)
End If
hider = 1
End Sub
Code: Select all
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If AutoHideToolStripMenuItem.Checked = True Then
If horv = "top" And hider = 0 Then
Me.Top = Screen.PrimaryScreen.Bounds.X - 49
hider = 1
End If
If horv = "left" And hider = 0 Then
Me.Left = Screen.PrimaryScreen.Bounds.Y - 43
hider = 1
End If
If horv = "right" And hider = 0 Then
Me.Left = Screen.PrimaryScreen.Bounds.Width - Me.Width + 43
hider = 1
End If
If horv = "bottom" And hider = 0 Then
Me.Top = Screen.PrimaryScreen.WorkingArea.Height - Me.Height + 48
hider = 1
End If
End If
Timer1.Enabled = False
End Sub
Private Sub Form1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.MouseEnter
If horv = "top" And hider = 1 Then
Timer1.Enabled = False
Me.Top = Screen.PrimaryScreen.Bounds.X
End If
If horv = "left" And hider = 1 Then
Timer1.Enabled = False
Me.Left = Screen.PrimaryScreen.Bounds.Y
End If
If horv = "right" And hider = 1 Then
Timer1.Enabled = False
Me.Left = Screen.PrimaryScreen.Bounds.Width - Me.Width
End If
If horv = "bottom" And hider = 1 Then
Timer1.Enabled = False
Me.Top = Screen.PrimaryScreen.WorkingArea.Height - Me.Height
End If
hider = 1
End Sub
Private Sub Form1_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.MouseLeave
hider = 0
Timer1.Enabled = True
End Sub
Private Sub AutoHideToolStripMenuItem_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AutoHideToolStripMenuItem.CheckedChanged
If AutoHideToolStripMenuItem.Checked = False Then
Me.TopMost = False
Else
Me.TopMost = True
End If
End Sub
And that should be it. Congratulations you now have an Auto-Hide feature!. Compile > Save and Run your new Application Bar to see the results.
Download this update: If you have any problems let me know and I will help you.
Thank you and stay tuned for more updates in the future

You do not have the required permissions to view the files attached to this post.
Im codenstuff.com...Im the moderator...iMBETA
Ty for the update i m going to download this and try it out as it looks insteresting
In this are there themes you can make btw?
Like i make a theme on paint or something and then can i use it on this
please reply back and tell me
In this are there themes you can make btw?
Like i make a theme on paint or something and then can i use it on this
please reply back and tell me
Hello,
It does have a theme option within the application but it is only for changing the background image of the bar but you can create your own image and use it within the application cooll;
It does have a theme option within the application but it is only for changing the background image of the bar but you can create your own image and use it within the application cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
o ok is it a different code for to do that or its a simple button in there please rep back i didn;t still see it so i dont know
Robby1998
Robby1998
W0w This is a really good program, I can't find an exe though..
Ziro wrote:W0w This is a really good program, I can't find an exe though..Hello,
If you are unable to compile this project you can use the pre-built .exe file if you open up the bin > debug folder in the download cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Copyright Information
Copyright © Codenstuff.com 2020 - 2023