Hi,
I am trying to create an application that looks and works like a webpage. For example, a webpage has table with two columns, on the left columns are all the links, on the right column, data corresponding the left column hyperlinks is displayed. I want something on similar lines in VB6.
All command button and links to several different forms are on right side, and the forms pertaining to the button/image/link on left side should be visible on right side.
I was able to get something started on the same lines, however there are few things I am getting stuck at.
Before you go through the queries, please download the accompanying zip file and try runing the application.
1) The forms should stay a particular distance from the top. That means the top and and left are always defined. I tried something, and it aint working the was I want as on resizing the main form, the forms loaded within that are not positionin properply
2) Also the first time the forms loads, its top position is differnt and next time the form position is different.
3) Once the form is loaded, the main form becomes inactive, though I know it would be like that, however what is required is that the main windows stays active and sub forms opening within that should work for them selves.
I know there is concept of MDI forms as well, I tried that also but of no success.
I hope you were able to understand what I looking forward to. So please do assist me on the same, and I will be really glad.
Why would you want to use Forms-in-Forms? You can simply use PictureBox, Frame... or any other Container control (much easier and less riskable) and make it scrollable with some ScrollBar-s.
Here's a sample on how to make Label-s link look-a-like. Create a control array of 'lblHyperlink' Labels, and set their .AutoSize property to True:
VB Code:
Option Explicit
Private mouseOverIndex As Integer
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
clearAllHyperlinks
End Sub
Private Sub lblHyperlink_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If mouseOverIndex <> Index Then
clearAllHyperlinks
With lblHyperlink(Index)
.FontBold = True
.FontUnderline = True
.ForeColor = vbBlue
End With
mouseOverIndex = Index
End If
End Sub
Private Sub clearAllHyperlinks()
Dim i As Integer
For i = 0 To lblHyperlink.Count - 1
With lblHyperlink(i)
.FontBold = False
.FontUnderline = False
.ForeColor = vbBlack
End With
Next i
mouseOverIndex = -1
End Sub
You may also want to try the WebBrowser control (menu Project>>Components>>Microsoft Internet Controls)...
The idea of frames is what I like. left side tool bar containing all the images...and on right side we get the frames with all the controls...however controling that becomes very untidy...as evrything is on the same page....is it possible that we create some sort a control, which has all those frames as contained and other controls on it, and I call it when a button is click on the left side.
And I was not able to control the width of frame to the form after leaving the left hand side toolbar out.
This is what I want my application to look like...developed in vb...doesnt look like vb...get some desing into it...theblank space on right is where i want my different forms/containers/controls to appear.
Frames are looking a good option...however it is too cumbersome at design time...anything else that i can do....like desing entire form and then display it in that white space or maybe desing the entire container with control out side the main form...however once command one is click...frame1 container appears with all the different controls....command 2 clicked...frame1 disappers and frame 2 appears...
how to control the frame height, width is also coming as some errors....