How how to create frames in a windows forms?

J

J.S.

I was under the impression that frames could be used in Windows forms in
earlier version of VB. However, in VB 2005 Express I don't see any such
tool/control. Is SplitContainer used for this purpose in VB 2005?

I want to create a frame in a Windows form because I'd like button clicks on
the left side of the form to change the form elements shown in the right
side of the form. Would each of the buttons on the left require a
corresponding form for the right container of the frame?

Thanks,
J.S.

--
 
C

Cor Ligthert [MVP]

JS,

Can you next time direct tell in the subject that it is about VB 2005
express, that saves others time when trying to help you.

I know nothing about the VB2005.

Thanks in advance.

Cor
 
J

J.S.

Ok, I used a splitcontainer with a treeview control in the left pane and the
listview pane in the right pane. Now if only I can show different forms in
the right pane when different parts of the treeview are clicked on the left.
:)
 
K

Ken Tucker [MVP]

Hi,

At one of the orlando dot net user group meeting Billy Hollis
did a demo on loading forms on the fly. He made a dll which contained the
form and loaded the form from a listbox. Here is a link to the vb.net 2003
code. I hope it helps.

http://dotnetmasters.com/SampleCode/LoadingFormsOnTheFly.zip

Ken
----------------------
I was under the impression that frames could be used in Windows forms in
earlier version of VB. However, in VB 2005 Express I don't see any such
tool/control. Is SplitContainer used for this purpose in VB 2005?

I want to create a frame in a Windows form because I'd like button clicks on
the left side of the form to change the form elements shown in the right
side of the form. Would each of the buttons on the left require a
corresponding form for the right container of the frame?

Thanks,
J.S.

--
 
M

Matt

Good luck with that. I would reccommend docking the treeview and
listview as dockstyle.fill. Anyway, there should be a template...
Explorer style, if I'm not mistaken..
 
J

J.S.

That's what I did, Matt, but I had two problems. One, when I double clicked
on the Treeview nodes in design-view it didn't open up the code view like it
does when you double click a button. Two, one the right side I need to show
different textboxes and buttons for each node so I suppose I need something
like a form instead of listview. Anyway, I am still trying to read MSDN.
 
J

J.S.

Hi Ken,

Thanks for that link; I'll download it right away and take a look at it. It
seems to be something that should work for me. In the meantime, I have just
been using the TabsControl.

J.S.
 
J

J.S.

http://dotnetmasters.com/SampleCode/LoadingFormsOnTheFly.zip

When I double click on any of the form names in the left pane it gives me an
error message which these details:


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: File or assembly name TestJustify.dll, or
one of its dependencies, was not found.
File name: "TestJustify.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at FormsOnTheFly.Form1.LoadForm(Object sender, EventArgs e) in
C:\Demonstration\OnTheFly\FormsOnTheFly\Form1.vb:line 216
at System.Windows.Forms.Control.OnDoubleClick(EventArgs e)
at System.Windows.Forms.ListBox.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\Storage\TestDeployment\TestJustify.dll
LOG: Appbase = D:\Documents and Settings\MyName\Desktop\My
Downloads\LoadingFormsOnTheFly\FormsOnTheFly\bin\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL
file:///C:/Storage/TestDeployment/TestJustify.dll.



************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
FormsOnTheFly
Assembly Version: 1.0.1580.15963
Win32 Version: 1.0.1580.15963
CodeBase:
file:///D:/Documents%20and%20Settings/Jag/Desktop/My%20Downloads/LoadingFormsOnTheFly/FormsOnTheFly/bin/FormsOnTheFly.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase:
file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top