回复 3楼Alice的帖子
你好,你说的open打开是指那个事件
是整个menu表示
还是menu中的次级menu表示呢
我现在初期表示只显示一级menu
次级menu是不表示的
以下是我的代码
麻烦给看看
- <c2:C1ContextMenuService.ContextMenu>
- <c2:C1ContextMenu
- Name="TreeContext"
- FontSize="{Binding Path=FontSize, Mode=OneWay}"
- Canvas.Left="200"
- Canvas.Top="180"
- BorderThickness="2"
- Height="Auto"
- Width="150"
- IsTabStop="False"
- HorizontalAlignment="Left">
- <c2:C1MenuItem
- x:Name="inPercentMenu"
- Header="割増追加"
- Visibility="Collapsed" >
- <c2:C1MenuItem x:Name="inChildMenu">
- <c2:C1MenuItem.Header >
- <my:CMenuTextBox x:Name="inChildMenuItem" />
- </c2:C1MenuItem.Header>
- </c2:C1MenuItem>
- </c2:C1MenuItem>
- </c2:C1ContextMenu>
- </c2:C1ContextMenuService.ContextMenu>
复制代码
- Private Sub inPercentMenu_SubmenuOpened(sender As Object, e As C1.Silverlight.SourcedEventArgs) Handles inPercentMenu.SubmenuOpened
- Me.inChildMenuItem.inTextBox.Focus()
- End Sub
复制代码- <UserControl x:Class="com.nec.cello.CMenuTextBox"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
- xmlns:ctl="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
- xmlns:c2="clr-namespace:C1.Silverlight;assembly=C1.Silverlight"
- xmlns:my="clr-namespace:com.nec.cello"
- mc:Ignorable="d"
- d:DesignHeight="40" d:DesignWidth="400" Foreground="Black">
- <Grid x:Name="LayoutRoot" Background="White">
- <Grid.RowDefinitions>
- <RowDefinition
- Height="Auto" />
- <RowDefinition
- Height="15*" />
- </Grid.RowDefinitions>
- <!-- 横積みパネル -->
- <StackPanel
- x:Name="inStackPanel"
- Style="{StaticResource HorizontalStackPanelStyle}">
- <my:CTextBoxTemp
- x:Name="inTextBox"
- Width="100"
- InputMethod.PreferredImeState="Off"
- IsTabStop="True"
- InputMethod.IsInputMethodEnabled="False" />
- <ctl:Label
- x:Name="inNmLabel" Content="%" Height="Auto" VerticalAlignment="Center"/>
- </StackPanel>
- </Grid>
- </UserControl>
复制代码 |