How to show AccessKey without pressing Alt in WPF?

此生再无相见时 提交于 2020-01-24 14:19:12

问题


I am using AccessText to show my text, where I need my Access Key should display by default without pressing Alt key. The Insert Table dialog (Office 2010) in MS word contains text which showing Access keys by default. I need such thing.

Is there any possibility?

Regards

Jawahar


回答1:


I think this is a windows setting. If u are using win7 look at the following.

OS_forum




回答2:


You can kind of fool the UI.

<Button x:Name="btnAccessG" Height="40" Width="100" Click="btnAccess_Click">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto" />  
        </Grid.ColumnDefinitions>
        <AccessText Grid.Row="0" Grid.Column="0" Visibility="Visible" Foreground="White">btn_AccessG</AccessText>
        <TextBlock Grid.Row="0" Grid.Column="0" Visibility="Visible">btn<Underline>A</Underline>ccessG</TextBlock>
    </Grid>          
</Button>

Setting AccessText Visible = Hidden does not work.



来源:https://stackoverflow.com/questions/8588004/how-to-show-accesskey-without-pressing-alt-in-wpf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!