5

I want to make my application look more like a native app than a .NET app and I use .NET because of Visual Designer and C#.

I've seen some native apps using a toolbar that looks very similar to Vista/7 menus.

Check out the example:

Windows Vista/7 style

Some native apps like Notepad++, Codeblocks, etc. uses the same Vista/7 style for toolbars. How can I do the same in C#? I know P/Invoke, so, I need to know the methods to be used or an example.

I don't use ToolBarStrip, I use ToolBar because of the nativeness. What P/Invoke can I use for make the Toolbar look like the above image (Vista/7 look)?

EDIT: Based on this question, I need to do the same in P/Invoke instead of Win32.

Community
  • 1
  • 1

2 Answers2

3

Notepad++ uses both versions of the native toolbar controls in its source code. I'd assume it chooses between the two based on the Windows version. You already tried the .NET wrapper for the legacy one (ToolBar class) so that's probably not the one you like.

The other one is the more recent Rebar control, also known as "Coolbar". Beware that its look-and-feel depends on the Windows version so don't go off the (dated) screenshots in the linked MSDN article. There is no official .NET wrapper for it, but programmers has written some. There is a Codeproject.com project that proposes one, I don't normally recommend any such projects but you sound quite capable of getting the bugs out.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
0

I see that the windows vista toolbar has fade settings applied which is easier to do with brushes in Xaml.

However here is a downloadable theme in codeproject that you can reference on how it is done there.

https://www.codeproject.com/Articles/18858/Fully-themed-Windows-Vista-Controls

Michael Edmison
  • 663
  • 6
  • 14