Wrox Programmer Forums
|
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
 
Old May 25th, 2005, 08:58 AM
Authorized User
 
Join Date: Apr 2005
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

 
Old May 25th, 2005, 10:41 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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? ...?)
 
Old May 25th, 2005, 11:35 AM
Authorized User
 
Join Date: Apr 2005
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its a web application, using vb.net as the code behind

 
Old May 25th, 2005, 12:00 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

So this was a sort of popup menu, localized to the vicinity of the options button?
 
Old May 26th, 2005, 03:10 AM
Authorized User
 
Join Date: Apr 2005
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes that would be true

 
Old May 26th, 2005, 10:02 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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).
 
Old May 27th, 2005, 03:27 AM
Authorized User
 
Join Date: Apr 2005
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Brian that was very helpful

D

 
Old June 1st, 2005, 08:23 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Make a image button as default submit button toshi ASP.NET 1.0 and 1.1 Basics 1 June 1st, 2006 05:25 AM
button mustang Visual Basic 2005 Basics 3 March 13th, 2006 09:12 AM
how to use 'Enter' button to trigger a button, thx raybristol ASP.NET 1.0 and 1.1 Basics 1 December 16th, 2005 06:56 AM
Button Help bspradeep Javascript How-To 5 July 24th, 2004 03:25 PM
Button acts depending on radio button values janise Access 4 March 10th, 2004 12:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.