A Quick Explorer-Like Interface

A Quick Explorer-Like Interface

Although the new VB5 Application Wizard can build a shell application with an Explorer-like interface, it is often desirable to drop a quick Explorer form into your code without the toolbar or the extra code included by the wizard. You can use only three controls to create a form quickly with the Explorer split-panel look and feel.

To get an Explorer interface up and running, drop a picture box onto a form and set the BorderStyle property to zero (none). Add two controls to the picture box. These controls will represent the left and right panels. Drop in this code:

 Private Sub Form_Resize()	' Optionally, resize manually if you don't 	' want container to cover entire form and 	' resize with form.	Picture1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeightEnd SubPrivate Sub Picture1_Resize()	Dim offset As Integer	Static percent As Single	offset = 4 * Screen.TwipsPerPixelX	If percent = 0 Then		percent = 0.5Else		percent = (Text1.Width + offset) / _			Picture1.Width	End If	Text1.Top = 0	Text1.Left = 0	Text1.Width = Picture1.Width * percent - offset	Text1.Height = Picture1.Height	Text2.Top = 0	Text2.Left = Text1.Width + offset	Text2.Width = Picture1.Width - Text2.Left	Text2.Height = Picture1.HeightEnd SubPrivate Sub Picture1_MouseMove(Button As _	Integer, Shift As Integer, X As Single, _	Y As Single)	Dim offset As Integer, pwidth As Integer	offset = 2 * Screen.TwipsPerPixelX	pwidth = Picture1.Width	If Button = vbLeftButton And X > 20 * _		offset And X < pwidth - 20 * offset Then		Text1.Width = X - offset	ElseIf X < 20 * offset Then		Text1.Width = 19 * offset	ElseIf X > pwidth - 20 * offset Then		Text1.Width = pwidth - 19 * offset	End If	Text2.Left = Text1.Width + 2 * offset	Text2.Width = pwidth - Text2.LeftEnd Sub

In this example, I used two multiline text boxes with scrollbars, but TreeView and ListView controls work just as well.

Share the Post:
XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing

data dictionary

Tools You Need to Make a Data Dictionary

Data dictionaries are crucial for organizations of all sizes that deal with large amounts of data. they are centralized repositories of all the data in organizations, including metadata such as