Building GUIs with VB.Net (from a VB.Net beginner)

G

Giovanni Dicanio

Hi,

I'd have some questions (I apologize if my terminology is not correct for
VB.Net, the fact is that I come from C++/Win32/MFC world):

#1 - Is it possible with VB and WinForm to make "resizable dialogs", with
hosted controls that automatically reposition/resize (basing on a given
layout) when the dialog is resized?

If someone here can understand that, what I'm searching is something like
this CResizableDialog MFC class:

http://www.codeproject.com/dialog/resizabledialog.asp

#2 - Is it possible to build MDI (Multi-Document Interface) apps using
VB.Net and WinForms?
Which class/properties should I study?

#3 - I've downloaded VB 2008 Express Editon (the IDE and exspecially the
IntelliSense look *great*!); I see that two options are offered to build
GUIs: WinForm and WPF.
It seems to me that WinForm is easier... but it maybe just the impression of
a beginner (me) in this context.

Moreover, it seems to me that WPF is kind of XML-based, so maybe is it less
efficient than WinForm, considering XML-parsing and tree-traversal costs?

Do you suggest to start developing new apps using WinForms or WPF?

Thanks very much in advance,
Giovanni
 
N

Newbie Coder

Giovanni,

Just think of it as managed C++ instead of unmanaged. If you can use managed C++
then it will be a breeze

Resizable forms are the default style in VB.NET WinForms

MDI - Yes of course
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Giovanni said:
Hi,

I'd have some questions (I apologize if my terminology is not correct for
VB.Net, the fact is that I come from C++/Win32/MFC world):

#1 - Is it possible with VB and WinForm to make "resizable dialogs", with
hosted controls that automatically reposition/resize (basing on a given
layout) when the dialog is resized?

If someone here can understand that, what I'm searching is something like
this CResizableDialog MFC class:

http://www.codeproject.com/dialog/resizabledialog.asp

Yes, that's built into the .NET controls. Just set the Dock property to
make a control resize itself to it's parent.
#2 - Is it possible to build MDI (Multi-Document Interface) apps using
VB.Net and WinForms?
Which class/properties should I study?

Add an item to your project and choose MDI Parent form. Or set the
IsMdiContainer property on a form if you want to start from scratch.
#3 - I've downloaded VB 2008 Express Editon (the IDE and exspecially the
IntelliSense look *great*!); I see that two options are offered to build
GUIs: WinForm and WPF.
It seems to me that WinForm is easier... but it maybe just the impression of
a beginner (me) in this context.

Windows Presentation Foundation is the new inteface introduced with
framework 3.0. I suppose that it will be easier to work with once you
get used to it.
Moreover, it seems to me that WPF is kind of XML-based, so maybe is it less
efficient than WinForm, considering XML-parsing and tree-traversal costs?

Not neccesarily. The WinForm classes are wrappers around the native
windows controls, so there is quite some overhead there too.
 
G

Giovanni Dicanio

Just think of it as managed C++ instead of unmanaged. If you can use
managed C++
then it will be a breeze

Managed C++ is not good for everything.
For example, if my understanding is correct, I can *not* use C++/CLI for WPF
or LINQ.

The Visual Studio developers are putting those new technologies into the
capable hands of VB and C#.

G
 
G

Giovanni Dicanio

Not neccesarily. The WinForm classes are wrappers around the native
windows controls, so there is quite some overhead there too.

Thank you for your pointing out.

So, on the other hand, if my understanding is correct, WPF is just a
"drawing surface", which is rendereded in completely different way.
In fact, I've tried to "play" with Spy++, and while Spy++ can detect the
single buttons into a WinForm dialog, it fails to detect them into a WPF
app; it just detects the whole WPF drawing rectangle, but not the hosted
controls.

Giovanni
 
T

Tom Shelton

Thank you for your pointing out.

So, on the other hand, if my understanding is correct, WPF is just a
"drawing surface", which is rendereded in completely different way.
In fact, I've tried to "play" with Spy++, and while Spy++ can detect the
single buttons into a WinForm dialog, it fails to detect them into a WPF
app; it just detects the whole WPF drawing rectangle, but not the hosted
controls.

Giovanni

WPF forms are rendered using DirectX (though, I believe they are only
hardware accelerated on Vista). All of the controls are lookless,
they have default themes that emulate the current OS theme, but all
controls can be restyled to look anyway you want - and yet still keep
the same behavior/functionality. WPF is quite fun once you get into
it :)
 
G

Giovanni Dicanio

WPF forms are rendered using DirectX (though, I believe they are only
hardware accelerated on Vista). All of the controls are lookless,
they have default themes that emulate the current OS theme, but all
controls can be restyled to look anyway you want - and yet still keep
the same behavior/functionality. WPF is quite fun once you get into
it :)

Very interesting! Thank you.

Could you please suggest a good book on WPF development?

Thanks,
Giovanni
 
T

Tom Shelton

Very interesting! Thank you.

Could you please suggest a good book on WPF development?

Thanks,
Giovanni

Sure... Here are the two I like:

"Windows Presentation Foundation Unleashed" (isbn: 0-672-32891-7) by
Adam Nathan. It's a Sams book - and I normally avoid these, but this
one is quite well written. It has a lot of examples, and screen shots
in full color. And, it focuses mainaly on the Xaml side of things.

"Applications = Code + Markup" (isbn: 978-0-7356-1957-9) by Charles
Petzold. This one is C# code, and focuses a lot on doing thing in
code (at least the first part of the book) before in moves into using
Xaml.

Both these books are pretty well written, and are pretty complimentary
- giving you an understanding of both the code, and the xaml side of
WPF.
 

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