 |
| VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1). |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

May 25th, 2005, 08:58 AM
|
|
Authorized User
|
|
Join Date: Apr 2005
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Button within a button
Hey,
I was wondering how would I go about creating a button within a button, for example on a web application you have a button called "OPTIONS" and that once clicked it would open up a small window, and within that window you would have buttons such as "SAVE", "PRINT", "EMAIL", I've seen it somewhere but can't remember where so if anyone can please help me or give me some sample code would be appreciated.
D
|
|

May 25th, 2005, 10:41 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
So this was a sort of popup menu, localized to the vicinity of the options button?
What kind of app are we talking about? (Windows app? Web app? ...?)
|
|

May 25th, 2005, 11:35 AM
|
|
Authorized User
|
|
Join Date: Apr 2005
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Its a web application, using vb.net as the code behind
|
|

May 25th, 2005, 12:00 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
So this was a sort of popup menu, localized to the vicinity of the options button?
|
|

May 26th, 2005, 03:10 AM
|
|
Authorized User
|
|
Join Date: Apr 2005
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes that would be true
|
|

May 26th, 2005, 10:02 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
As far as I know, the most common way to do this is to define a <div> with the secondary buttons/controls on/in it. (Divs can be positioned, layered, made visible or invisible, etc., yet they are an element of the form in which they are defined, unlike popup windows, alert dialogs and confirm dialogs.)
When the primary button is clicked, show the div, allowing the controls it has to be clicked/selected. Once that happens, hide the div again. (An element that is not visible is not submitted with the form; you will need to keep track of what was done within the div somewhere else, before you re-hide it.)
If you show this div as the result of merely rolling over the primary button, you have the rudiments of how HTML menus are done (items I'm sure you've seen while making your way about the wwweb).
|
|

May 27th, 2005, 03:27 AM
|
|
Authorized User
|
|
Join Date: Apr 2005
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Brian that was very helpful
D
|
|

June 1st, 2005, 08:23 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
One clarification regarding the distinction between HTML visibility and control visibility in .NET:
In HTML you can set the DHTML visibility property of a control to "hidden". This only means it's not visible in the browser canvas. However, controls inside a hidden HTML element are still on the page and will therefore post values.
This is in contrast to setting a control's Visible server property to "false". This causes the control not to render at all and therefore not post values. If the control is rendered to the page it will post values regardless of their DHTML visibility.
- Peter
|
|
 |