在我看来,Ribbon控件有文本框的问题.我期待一个常见的TextBox控件行为:当文本超出宽度时,固定宽度和可见插入符号.但RibbonTextBox控件更改其宽度,当文本超出右限制时,溢出不可见.
我在博客上发现了一个像这样的东西:
var img = SearchButton.Template.FindName("image", SearchButton);
if (img != null && img is Image)
(img as Image).Visibility = Visibility.Collapsed;
var lbl = FindTemplateControl<Label>(SearchText);
var border = SearchText.Template.FindName("Bd", SearchText);
if (border != null && border is Border && img != null && lbl != null)
{
(border as Border).Width = SearchText.ActualWidth - (((Image)img).ActualWidth + lbl.ActualWidth);
}
Run Code Online (Sandbox Code Playgroud)
但我真的不想做这样的解决方法.有没有其他更简单的方法来实现简单的TextBox行为?
我在我的应用程序中有一个Microsoft Ribbon实例,我试图将一个RibbonGroup的内容绑定到我的ViewModel中的一组图像,其方式是:(a)图像显示为RibbonButton的大图像(b)当用户单击其中一个RibbonButton控件时,相应的图像被设置为集合的CurrentItem(当前是EntityCollection).
我尝试了各种手段,基于以下内容......
<DataTemplate x:Key="viewButtonTemplate">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<ribbon:RibbonButton Grid.Row="0" Label="{Binding Path=ImageType.Description}"
LargeImageSource="{Binding Path=ImageData, Converter={StaticResource BinaryJpegToImageSourceConverter}}"
Command=""/>
<Image Grid.Row="0" MaxWidth="30" Source="{Binding Path=ImageData, Converter={StaticResource BinaryJpegToImageSourceConverter}}"/>
<TextBlock Grid.Row="1" Text="{Binding Path=ImageType.Description}"/>
</Grid>
</DataTemplate>
<ribbon:RibbonGroup Header="View">
<ListBox Name="imageList" Background="Transparent" BorderThickness="0" Focusable="True" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Path=Images}" ItemTemplate="{StaticResource viewButtonTemplate}" ScrollViewer.VerticalScrollBarVisibility="Hidden">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ListBox>
</ribbon:RibbonGroup>
Run Code Online (Sandbox Code Playgroud)
但一切都无济于事!我根本无法让RibbonButton按照我的意愿行事.注意:模板中的附加图像控件实际上允许它工作; 它似乎与让ListView识别RibbonButton的点击有关.
有什么建议?
我有几个图像文件,我想在项目之间共享(常见的图标)我在一个程序集中将它们放在我创建的每个解决方案中...我将文件放在一个名为Icon的文件夹中,我将构建作为内容副本始终.我已经验证使用这些图标创建了一个文件夹...但是我的其他程序集无法找到它们...
<r:RibbonGroup Header="Users">
<r:RibbonButton >
<r:RibbonButton.LargeImageSource>
<BitmapImage UriSource="..\Icons\UserIcon.png" />
</r:RibbonButton.LargeImageSource>
</r:RibbonButton>
</r:RibbonGroup>
Run Code Online (Sandbox Code Playgroud)
我尝试过几种方式格式化uri ...但它永远不会成功.如果图标在实际装配中虽然它们有效...
我想将RibbonWindow的标题居中,而不是让它在侧面对齐.
这个帖子说它有一个答案: 通过XAML Code中心WPF RibbonWindow标题
但它不起作用.
贝娄是一个图像和相应的代码.

<RibbonWindow x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<Ribbon>
<Ribbon.TitleTemplate>
<DataTemplate>
<TextBlock TextAlignment="Center" HorizontalAlignment="Stretch" Width="{Binding ElementName=Window, Path=ActualWidth}">ApplicationTitle
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="0" Color="MintCream " BlurRadius="10" />
</TextBlock.Effect>
</TextBlock>
</DataTemplate>
</Ribbon.TitleTemplate>
</Ribbon>
</Grid>
</RibbonWindow>
Run Code Online (Sandbox Code Playgroud)
我正在使用VS 2012,.NET 4.5和附带的System.Windows.Controls.Ribbon程序集.
我有以下情形:我为开发服务器中的几个实体创建了一些功能区。我现在可以将此功能区定制导出到另一台服务器吗?还是我必须再次创建它们?
我一直在使用CRM 2011和Ribbon Workbench。
虽然某些 Office 功能区控件属性可以直接设置(例如标签),但大多数使用回调来设置属性。例如按钮的图像:
<button id="btnRecalculate" getImage="GetRibbonControlImage" label="Recalculate Now" onAction="OnButtonAction" size="normal" />
Run Code Online (Sandbox Code Playgroud)
文档对这些回调的语法非常清楚,但没有说明调用它们的时间和频率。
我现在面临一个问题,当以编程方式更改值时,我想修改功能区上的其中一个属性(例如按钮上的工具提示)。我为超级提示定义了一个回调,如下所示:
<button id="btnSetServerURL" getSupertip="GetSuperTip" label="Set Server URL" />
Run Code Online (Sandbox Code Playgroud)
以及隐藏的代码:
public string GetSuperTip(IRibbonControl control)
{
switch( control.Id )
{
case "btnSetServerURL":
return "Click to set the server URL. (Currently: " + API.URL + ")";
default:
return "";
}
}
Run Code Online (Sandbox Code Playgroud)
当该 URL 更改时,下次用户将鼠标悬停在该按钮上时,我希望调用 GetSuperTip 回调并显示消息以显示正确的当前 URL,但现在该值只是第一次设置,再也不会设置。
有什么办法可以得到我寻求的行为吗?这是一个 Excel 插件,据我所知,WPF 样式绑定不是一个选项。
我正试图在http://jsfiddle.net/chriscoyier/H6rQ6/1/更改Chris的角落色带片段.我希望功能区位于左侧而不是右侧
这是我到目前为止所做的http://jsbin.com/imUQula/1/功能区的上半部分和下半部分没有变化.我希望上部平坦的水平和底部平坦的垂直
CSS
.wrapper {
margin: 50px auto;
width: 280px;
height: 370px;
background: white;
border-radius: 10px;
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
position: relative;
z-index: 90;
}
.ribbon-wrapper-green {
width: 85px;
height: 88px;
overflow: hidden;
position: absolute;
top: -3px;
left: -3px;
}
.ribbon-green {
font: bold 15px Sans-Serif;
color: #333;
text-align: center;
text-shadow: rgba(255,255,255,0.5) 0px 1px 0px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
position: relative; …Run Code Online (Sandbox Code Playgroud) 我已经看到了很多关于如何ActivateTab OnLoad但无法让它动态工作的代码......例如,单击工作表按钮。
Sheet1 上有一个按钮指向startHereConfigure
<customUI onLoad="RibbonOnLoad"
xmlns="http://schemas.microsoft.com/office/2009/07/customui">
Public Rib As IRibbonUI
Sub RibbonOnLoad(ribbon As IRibbonUI)
Set Rib = ribbon
End Sub
Sub startHereConfigure()
Rib.ActivateTab "Configure"
End Sub
Run Code Online (Sandbox Code Playgroud)
我希望能够调用 startHereConfigure(和其他类似的子程序)以突出特定选项卡 - 我该怎么做?
当我手动隐藏行/列时,有没有办法触发Excel VBA中的事件(调用子)?
当隐藏在特定工作表中时,我希望在所有后续工作表中隐藏相同的行.
那可能吗?
提前致谢
创建与其父容器重叠的 div 的最佳方法是什么。我正在使用引导程序并想要创建一个比其容器更大的横幅,我想创建以下内容:

这是我到目前为止的代码:
<div class="container container-white no-pd">
<div class="service-banner">
<div class="text-center">
Headline title here <a href="#" title="title" class="btn btn-default">Our Services</a>
</div>
</div><!--/service banner-->
</div><!--/container-->
Run Code Online (Sandbox Code Playgroud)
这给了我以下内容:

有什么建议吗?