|
-
Oct 9th, 2005, 09:29 PM
#1
Thread Starter
New Member
DropDownButton outside of a Toolbar
Is it possible in .NET to easily make a drop down button control, such as you might find in a toolbar, but in another location on a form?
To be more precise, what I want is a button with two functions, depending on which part is clicked. The greatest area is on the left side, represented by the icon for the button, and has the default action. A small sliver on the right side of the button is represented by a drop down arrow, and presents a menu when clicked.
This is very intuitive behaviour, and I really want to use it in an application, but the only control I can find with this behaviour is the toolbarbutton control
-
Oct 9th, 2005, 09:41 PM
#2
Re: DropDownButton outside of a Toolbar
Welcome to the Forums.
Yes, you can display the popup dropdown menu of a toolbar button manually via code in any location of the form.
I have some code, hold on...
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 9th, 2005, 09:44 PM
#3
Re: DropDownButton outside of a Toolbar
I found it. It shouws how to call the drowdown menu from a toolbar button click and position it. Just change the X/Y location to position the menu where you want.
http://www.vbforums.com/showpost.php...18&postcount=8
Moved from .NET Architecture and Design
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 10th, 2005, 12:11 AM
#4
Re: DropDownButton outside of a Toolbar
I think the point here is that segfault doesn't want to use a Toolbar, but rather just a regular Button on a form with the same behaviour as a ToolBarButton with a drop-down menu. You can easily display a drop-down menu when a Button is clicked by creating a ContextMenu and calling its Show method from the Button's Click event handler. You pass the Button as the first argument and the relative location as the second. Given that you want to have a two part button, I'd say that your best bet would be to create a UserControl that contained two Buttons adjacent to each other and a ContextMenu. You may have to fiddle with things a bit to make it look like two parts of the same button rather than two seperate buttons. There is plenty of information in the help or at MSDN on-line about creating UserControls.
-
Oct 10th, 2005, 09:47 AM
#5
Thread Starter
New Member
Re: DropDownButton outside of a Toolbar
Thanks for the responses, guys. jmcilhinney hit the nail on the head. I haven't educated myself on .NET user controls, but as long as it's well documented, i'll be ok.
On a different subject, since I'm new here, will someone explain why this thread was not appropriate for the .NET Architecture and Design forum? I'm actually developing in C#, but the prebuilt controls are language independant, right?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|