How to change the shape of a button in visual c++? - visual-c++

Is there an easy way to change the shape of a button in a form?

There could be other ways, but if you are not using WPF, you can use Images for buttons.
If you are using WPF, there are lots of options you can explore.

This might be a bit old, but may point the way, look at ownerdraw properties and styles and messages. http://msdn.microsoft.com/en-us/library/ms364048(v=vs.80).aspx
As an aside why would you want to change the shape of the button. Bear in mind your users, they more than likely don't like change.

You are referring to Ownerdraw buttons. The following links shall help you.
http://www.codeproject.com/KB/buttons/roundbuttons.aspx
how to create a round/circular button in win32 API using visual c++

Related

Does rust-tui provide any mouse functionality above Termion?

Rust TUI provides things like tabs and widgets. But they can't be clicked on. Termion supports this. Is there anyway to get click events to work in rust-tui's widgets?
Some other toolkits like blessed.js support this too.
I grepped the source code for "click" and couldn't find any examples of this.
Digging around this is an already-filed enhancement request.
https://github.com/fdehau/tui-rs/issues/166
The Rust-tui widgets do not support click events.

Adding a text box in Android Studo

Trying to use AndroidStudio (3.4.2) for the first time and it appers to be substantially different to the tutorial at
https://developer.android.com/training/basics/firstapp/building-ui
For example:
There is no layout editor toolbar let alone a show button.
There is no autoconnect button
It doesn't show any wiggly lines from the middle of the blue square to its edges.
When adding a text box it goes to the top left and can't be moved.
WTF is going on? This is awful!
So I know this may sound like the hard answer, but in the long run it will make life 1000x easier.
You need to learn XML to design the activities. It's fairly simple and really easy to research. The reason the textbox can't be moved is because the default layout is ConstraintLayout. In order to fix this, go to the xml file and change the Constraint layout to either Relative layout or Linear Layout. In the end, its more simple to learn straight xml.
I suggest you learn Android programming from here or somewhere else because the Android documentation can be confusing especially for a beginner like yourself and trust me, I've been there.

Android Layout Shape Design

How can I create a layout similar to this, using shapes?
there are various tools available in market for good UI designing in android, also you can use intelli j idea as an IDE and go for its tutorials ,other links like appinventor , droidDraw will also help you to make a good looking and impressive UI.
also if you want to create exact UI just like that you can use frameLayout in xml.and design it accordingly.

how to add a custom mfc control to the dialog window?

I've derived a class from CStatic in MFC. But I don't know how to add it to my dialog window.
This mfc application that I'm working on is a dialog based application.
In Gtk+ or Qt we could use layouts and add our widgets to them, but in mfc it doesn't seem to be such a mechanism. I'm wondering how is it possible for an custom made control to be added to another GUI element!!!
Please give me a simple example if you can.
thank you
I think the technique you are looking for is subclassing (MSDN).
There is a good sample on that page too.

Find out which colours are in use when using the MFC Feature pack in Office 2007 style

I'm updating some of our legacy C++ code to use the "MFC feature pack" that Microsoft released for Visual Studio 2008. We've used the new classes to derive our application from CFrameWndEx, and are applying the Office 2007 styles to give our application a more modern appearance. This gives us gradient filled window titles, status bars etc, and the use of the ribbon toolbars.
However, our application contains some owner drawn controls, and I'd like to update these to match the color scheme used by the feature pack. Ideally I'd like to know the light and shaded toolbar colors that are currently in use.
I've had a hunt around the documentation and web and have not yet found anything. Does anyone know how to find this information out?
[Edit]
In particular we need to find out which colors are being used at runtime. You can change the appearance of your application at runtime using the new static function CMFCVisualManager::SetDefaultManager.
The following msdn page shows you what kind of styles are available, in particular the Office2007 look:
link to msdn
Have you looked in the MFC source code, which you'll find in something like
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc
Looks like CMFCVisualManager offers several methods for getting color information, e.g.
CMFCVisualManager::GetSmartDockingBaseGuideColors()
CMFCVisualManager::GetToolbarHighlightColor()
Take a look at the MSDN docs for CMFCVisualManager.
Good suggestion, but unfortunately they just return various shades of grey, when currently I'm running my application with the style CMFCVisualManagerOffice2007::Office2007_LunaBlue
Annoyingly the msdn help is "under construction" so doesn't even tell you what they are supposed to be doing!
afxGlobalData contains some useful information on the current colours, brushes and fonts being used by the MFC Feature Pack. In particular I use afxGlobalData.m_clrBarFace when painting my own control bar backgrounds.
(note that I am not in front of my work PC so the above syntax isn't spot on.)
Have you tried: 2007 Office System Document: UI Style Guide for Solutions and Add Ins
?
I guess you could use your favourite image editor and pick the colors from a screen grab.
"I guess you could use your favourite image editor and pick the colors from a screen grab."
This is essentially what I'm doing at the moment, and I've defined a list of constants from which I pull out the colours. Doesn't seem very elegant though!
Looks like CMFCVisualManager offers several methods for getting color information, e.g.
CMFCVisualManager::GetSmartDockingBaseGuideColors()
CMFCVisualManager::GetToolbarHighlightColor()
Take a look at the MSDN docs for CMFCVisualManager.
#GateKiller, the OP isn't developing an Office 2007 add-in, so the UI guidelines won't really help. It's an MFC application using the Visual C++ 2008 Feature Pack which allows MFC apps to take on the Office 2007 look and feel.
Good suggestion, but unfortunately they just return various shades of grey, when currently I'm running my application with the style CMFCVisualManagerOffice2007::Office2007_LunaBlue
CMFCVisualManagerOffice2007::GetTabFrameColors - the clrFace output param is grey?
Perhaps they're all masks on top of a single base hue for each theme? Assuming you can determine which color scheme is in effect with CMFCVisualManagerOffice2007::GetStyle(), perhaps you can figure out what that hue is and then do some masking with the GetxxxColor() methods.

Resources