Create a button with a down arrow icon - c

I want to create a button with a down arrow icon that displays a menu when clicked. I have found the following button type:
But this button can be pressed in two places (on the left of the vertical line and on the right of the vertical line), also I don't want the button to have a vertical line, I want it to be something like this:
Can this be done in Windows API?

What you are looking for can be done using either:
a standard COMBOBOX control with the CBS_DROPDOWNLIST window style:
(source: s-msft.com)
A Menu button:
(source: s-msft.com)
However, this is not a standard Win32 control. MFC has a CMFCMenuButton class for it, but in Win32 you have to owner-draw a standard BUTTON control to achieve the same effect:
Menu button arrow with raw Win32
When the button is pushed, you can display your pop-up menu as needed, using TrackPopupMenu() or equivalent.

Related

TestStack.White click MahApps Hamburger Menu item

Using TestStack.White I'm trying to click a menu item in the MahApps Hamburger Menu. For example, if I grab any example from their documentation, I'm able to capture a "HamburgerMenuIconItem" from TestStack like this:
var item = window.Get(SearchCriteria.ByAutomationId("Test")).GetParent<UIItem>();
Which looks correct with the "HamburgerMenuIconItem" name, and properties like the text and icon. But clicking it does nothing...
I've tried to put in a Button - either to wrap the text / label, or the icon, but that messes up the Command functionality of the menu item if there is a view declared in the Tag (what I probably need).
Any ideas on how I can click a MahApps menu item in a TestStack.White UI test?

Is it possible to click drag a button image in WPF?

I have a Toolbar with buttons that have images just above their text. I want users to click the button and then drag. That should drag the image as long as the mouse button is held down. This should also work for touch screens (fingers).
I've been trying to use the code from this answer Mouse click and drag Event WPF. But it doesn't seem to do anything. I end up dragging the entire form.
Any suggestions on how I can start this or if it is even possible?

Telerik RadDock on left side of main form in Winform application

I have a WinForm application that I would like to add a RadDoc like a popup menu on the left inside form main.
The user should be able to hover to the left side of the screen or click some tab on the left side of the screen and then the menu bar will appear.
The RadDock control itself does not have a auto hide.
I can hide the ToolWindow inside the RadDock but this leaves a blue background where the ToolWindow would show.
Also, when the ToolWindows are "AutoHide" they are tabbed at the bottom but they need to be tabbed vertically on the left.
The last thing is that I can't seem to set the "popup" size of the ToolWindows.
I would suggest that you go through the RadDock documentation.
Auto Hide article: http://www.telerik.com/help/winforms/dock-architecture-and-features-auto-hiding-windows.html
Arranging windows: http://www.telerik.com/help/winforms/dock-architecture-and-features-arranging-dockwindows.html
Modifying windows size: http://www.telerik.com/help/winforms/dock-object-model-example-building-an-advanced-layout-at-runtime.html
To make the whole control collapsible, you can use the RadCollapsiblePanel control: link.

How to use an image as a button in GTK?

How to use an image as a button in GTK in c language in code blocks? I have tried making the button of same color as that of the background and then adding image on it. But there is a outline or shadow still there. So, how can i remove those shadows or is there a way to directly use an image as a button?
One way is outlined by #Shabhaz, by putting the image in an EventBox, and handling the button-press event.
The other way is by placing the image in the button and customizing the style of the button to remove the outline and the shadow. You would call gtk_rc_parse_string() to define an outline-less button class, and gtk_widget_set_name() on your button to apply the style.

Add a Tool button in titlebar in GTK

How to add a button (tool) in title bar like maximize and minimize button in title bar.
I need to add help tool button in my window title bar..?
Thanks in Advance
You can remove the window manager decoration and place some widgets on top of your toplever window, emulating the same behavior.

Resources