Simulate Win95 Taskbar Within Your App

The Windows 95 taskbar (with the Auto Hide check box set) is quite attractive and provides a compact, nonintrusive way to access and organize information. You can easily simulate this functionality in a VB program and provide a useful alternative to a pull-down menu and/or SpeedButton. To set up such a “taskbar” in your VB application, include a control that can act as a container for other controls in your VB form. The PictureBox control looks good and works well; or you can use a Panel or a Frame.

Set the PictureBox’s Align and AutoSize properties. The Align property indicates where the taskbar will reside on the form, and the AutoSize property ensures that the PictureBox is sized to fit the contours of its parent form whenever the form is resized.

Set the PictureBox’s Visible property to False. Make sure your custom taskbar is not visible until the mouse is moved over a defined “hot” zone on the form. A “hot” zone is a location on the screen defined in X or Y coordinates. You can use these coordinates in any unit of measurement, such as twips or pixels. Set the Parent form’s ScaleMode property to the unit of measurement you wish to work in.

Set the Width and/or Height of the PictureBox to appropriately show embedded controls or information. Set up code in the Form’s MouseMove event to handle the taskbar. This code aligns the taskbar to the left of the screen:

 'Object		Property		Setting'------		--------		-------'Form		Name			FrmTaskBarEx'			ScaleMode	Pixel'PictureBox	Name			PicTaskBar'			Align		Align Left'			AutoSize		True'			Visible		FalsePrivate Sub Form_Load()' Set Width of PictureBox to 1/4 size of Parent form ' when form is loaded. This is wide enough to show ' all of the controls I embedded in the PictureBox,' and will vary with each application.	PicTaskBar.Width = Me.ScaleWidth / 4End SubPrivate Sub Form_MouseMove(Button As _	Integer, Shift As Integer, X As Single, Y As Single)' When the horizontal mouse position is less ' than or equal to defined hot zone' (in this case, horizontal pixel position 4), show taskbar	If (X <= 4) Then 		PicTaskBar.Visible = True		' When the horizontal mouse position is 		' greater than the width of the 		' PictureBox, hide taskbar	ElseIf (X > PicTaskBar.Width) Then		PicTaskBar.Visible = False	End IfEnd Sub
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may

man on floor with data

DevX Quick Guide to Data Ingestion

One of the biggest trends of the 21st century is the massive surge in internet usage. With major innovations such as smart technology, social media, and online shopping sites, the internet has become an essential part of everyday life for a large portion of the population. Due to this internet

payment via phone

7 Ways Technology Has Changed Traditional Payments

In today’s digital world, technology has changed how we make payments. From contactless cards to mobile wallets, it’s now easier to pay for goods and services without carrying cash or using a checkbook. This article will look at seven of the most significant ways technology has transformed traditional payment methods.