是否有人在Vista / Win7中创建了WPF工具栏控件?

时间:2022-10-17 22:54:49

I would like to add a toolbar, that looks like the one in the Windows 7 Explorer (see picture below), to a WPF-application. Because I'm new to WPF I wondered if there is a WPF-Control (free / open source) I can use instead of having to create a new one. I already searched for it but could not find anything useful.

我想在WPF应用程序中添加一个工具栏,它看起来像Windows 7资源管理器中的工具栏(见下图)。因为我是WPF的新手,我想知道是否有WPF-Control(免费/开源)我可以使用而不必创建一个新的。我已经搜索过了,但找不到任何有用的东西。

alt text http://www.pic-upload.de/23.04.09/juv56l.png

alt text http://www.pic-upload.de/23.04.09/juv56l.png

2 个解决方案

#1


You could just re-style the WPF TabControl to look like that. It's not very hard, just setting the Background with a nice LinearGradientBrush could get you very close to that.

您可以将WPF TabControl重新设置为样式。这不是很难,只需用一个漂亮的LinearGradientBrush设置背景就可以让你非常接近。

Here's a (crappy colors) example:

这是一个(糟糕的颜色)示例:

<ToolBar>
   <ToolBar.Background>
      <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
         <GradientStop Color="White" Offset=".1" />
         <GradientStop Color="LightBlue" Offset=".3" />
         <GradientStop Color="LightSteelBlue" Offset=".8" />
      </LinearGradientBrush>
   </ToolBar.Background>
</ToolBar>

Even better if you put it in a style.

如果你把它放在一个风格中更好。

#2


looks like the image didn't work, here's the link

看起来图像不起作用,这里是链接

http://www.pic-upload.de/23.04.09/juv56l.png

#1


You could just re-style the WPF TabControl to look like that. It's not very hard, just setting the Background with a nice LinearGradientBrush could get you very close to that.

您可以将WPF TabControl重新设置为样式。这不是很难,只需用一个漂亮的LinearGradientBrush设置背景就可以让你非常接近。

Here's a (crappy colors) example:

这是一个(糟糕的颜色)示例:

<ToolBar>
   <ToolBar.Background>
      <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
         <GradientStop Color="White" Offset=".1" />
         <GradientStop Color="LightBlue" Offset=".3" />
         <GradientStop Color="LightSteelBlue" Offset=".8" />
      </LinearGradientBrush>
   </ToolBar.Background>
</ToolBar>

Even better if you put it in a style.

如果你把它放在一个风格中更好。

#2


looks like the image didn't work, here's the link

看起来图像不起作用,这里是链接

http://www.pic-upload.de/23.04.09/juv56l.png