Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1531

[CODE] Responsive applications in VB6 (and immune to resolution changes)

$
0
0
Make VB6 applications look, feel and work state-of-the-art.

See this video for more:
https://youtu.be/2RPnJotSYj0

I HAVE HEAVILY MODIFIED THE CODE NOT COMPLETELY CODED IT. THE CREDITS CAN BE FOUND BELOW. I HAVE ALSO CONSOLIDATED OTHER PROJECTS TO CREATE A BASIC PACKAGE FOR BEGINNERS THAT WILL MAKE YOUR APPLICATIONS LOOK GREAT.

With the following code, your form controls will automatically resize with the forms and look awesome (The looks have to do with manifests which I have credited below). Also, it is responsive to resolution changes.

To use the source code:
Visit the manifest creator page for instructions on theming.

For the automatic resizing:
Add the module ScalingModule (Module2) to your project.

Then declare in each form:
Private InitialControlList() As ControlInitial

Then insert the following code in all forms to be resized:

Private Sub Form_Load()
InitialControlList = GetLocation(Me)
ReSizePosForm Me, Me.height, Me.width, Me.Left, Me.Top
End Sub

Private Sub Form_Resize()
ResizeControls Me, InitialControlList
End Sub

Play around with the sample project for more! You may need to add a few components/references for it to work. The exe should probably work out of the box (But I can't assure it).

Credits:

I modified (heavily) the inefficient code for resizing form and controls found here:
http://www.dreamincode.net/forums/to...reen-size-vb6/

The manifest creator for better looks:
http://www.vbforums.com/showthread.p...nifest-Creator
(See #79 on page 2 for better code)

A TON of interfaces to make VB6 look better:
http://www.vbforums.com/showthread.p...ary-oleexp-tlb

Taskbar Progressbar Animation:
http://www.vbforums.com/showthread.p...n-taskbar-etc)

Source Codes:

The Project's Source code (all that you saw in the video) can be found here:
http://bit.do/vb6-1-all

Everything except the taskbar integration:
http://bit.do/vb6-1-no-task

Please credit me and the others above!

Viewing all articles
Browse latest Browse all 1531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>