久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='gjUqW'></bdo><ul id='gjUqW'></ul>
<i id='gjUqW'><tr id='gjUqW'><dt id='gjUqW'><q id='gjUqW'><span id='gjUqW'><b id='gjUqW'><form id='gjUqW'><ins id='gjUqW'></ins><ul id='gjUqW'></ul><sub id='gjUqW'></sub></form><legend id='gjUqW'></legend><bdo id='gjUqW'><pre id='gjUqW'><center id='gjUqW'></center></pre></bdo></b><th id='gjUqW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='gjUqW'><tfoot id='gjUqW'></tfoot><dl id='gjUqW'><fieldset id='gjUqW'></fieldset></dl></div>

  1. <tfoot id='gjUqW'></tfoot>
  2. <legend id='gjUqW'><style id='gjUqW'><dir id='gjUqW'><q id='gjUqW'></q></dir></style></legend>
  3. <small id='gjUqW'></small><noframes id='gjUqW'>

      WPF 選項卡鍵導航

      WPF Tab Key Navigation(WPF 選項卡鍵導航)
      <i id='DxG4a'><tr id='DxG4a'><dt id='DxG4a'><q id='DxG4a'><span id='DxG4a'><b id='DxG4a'><form id='DxG4a'><ins id='DxG4a'></ins><ul id='DxG4a'></ul><sub id='DxG4a'></sub></form><legend id='DxG4a'></legend><bdo id='DxG4a'><pre id='DxG4a'><center id='DxG4a'></center></pre></bdo></b><th id='DxG4a'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='DxG4a'><tfoot id='DxG4a'></tfoot><dl id='DxG4a'><fieldset id='DxG4a'></fieldset></dl></div>

      <tfoot id='DxG4a'></tfoot>
        <tbody id='DxG4a'></tbody>
      <legend id='DxG4a'><style id='DxG4a'><dir id='DxG4a'><q id='DxG4a'></q></dir></style></legend>

            <bdo id='DxG4a'></bdo><ul id='DxG4a'></ul>

            1. <small id='DxG4a'></small><noframes id='DxG4a'>

              • 本文介紹了WPF 選項卡鍵導航的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我們有一個基于 WPF .NET 4.0 C# 的應用程序.我們從 XML 定義(不是 XAML)構建我們的用戶界面,但在下面我們使用 WPF 來呈現 UI.也就是說,在運行時,我們基于 XML 定義創建 WPF UI.

                We have a WPF .NET 4.0 C# based application. We built our user interface from XML definitions (not XAML) but underneath we use a WPF to present the UI. That is at runtime, we create the WPF UI based on our XML definition.

                標簽導航有問題.我們為文本和組合框控件設置了 TabStop、TabIndex.
                但是標簽導航不起作用.如何使標簽導航適用于此布局?

                We have a problem with tab navigation. We set TabStop, TabIndex, for text and combo box controls.
                But tab navigation is not working. How to make tab navigation work for this layout?

                推薦答案

                WPF 將整個 UI 樹視為單個 Tab 范圍.它不會像您期望的那樣分解成更小的區域.這包括 UserControls 中的控件.

                WPF treats the entire UI Tree as a single Tab scope. It isn't broken up into smaller areas such as you would expect. This includes controls inside UserControls.

                例如,如果你有

                <StackPanel>
                    <TextBox Name="TextBox1" />
                    <MyUserControl />
                    <TextBox Name="TextBox3" />
                </StackPanel>
                

                MyUserControl 看起來像

                <MyUserControl>
                    <TextBox Name="TextBox2"  />
                </MyUserControl>
                

                默認選項卡循環為 TextBox1、TextBox2、TextBox3.這是因為沒有定義 TabIndex 屬性,所以所有控件都以默認的 Tab 鍵順序運行,也就是它們添加到 UI 中的順序.

                The default tab cycle would be TextBox1, TextBox2, TextBox3. This is because no TabIndex properties are defined, so all controls run at the default tab order, which is the order in which they're added to the UI.

                如果您在控件上設置 TabIndex,如下所示,

                If you set the TabIndex on your controls such as below,

                <StackPanel>
                    <TextBox Name="TextBox1" TabIndex="1" />
                    <MyUserControl TabIndex="2" />
                    <TextBox Name="TextBox3" TabIndex="3" />
                </StackPanel>
                

                您的制表符將更改為 TextBox1、TextBox3、TextBox2.這是因為 TextBox2 沒有指定 TabIndex,因此假定為默認值,并且在所有其他指定了 TabIndex 的控件循環通過之后,它會被選項卡化.

                Your tabbing would change to TextBox1, TextBox3, TextBox2. This is because TextBox2 doesn't have a TabIndex specified, so the default is assumed and it is tabbed to after all the other controls with a TabIndex specified get cycled through.

                我通常解決這個問題的方法是將 UserControl 內控件的 TabIndex 綁定到 UserControl.TabIndex.

                The way I usually get around this is to bind the TabIndex of controls inside the UserControl to the UserControl.TabIndex.

                例如,將以下綁定添加到 UserControl 將使 Tab 循環再次正確

                For example adding the following binding to the UserControl would make the Tab cycle correct again

                <MyUserControl>
                    <TextBox Name="TextBox2" TabIndex="{Binding Path=TabIndex, RelativeSource={RelativeSource AncestorType={x:Type local:MyUserControl}}}" />
                </MyUserControl>
                

                我通常更喜歡在 UserControl 的 Loaded 事件中設置此綁定,而不必記住在 UserControl 內的所有控件上設置此綁定.我相信還有更有效的方法可以做到這一點,但是問題出現的頻率還不夠高,讓我坐下來花時間研究如何正確使用選項卡范圍以避免這種解決方法.

                I usually prefer to set this binding in the Loaded event of the UserControl instead of having to remember to set this binding on all the controls inside the UserControl. I'm sure there are also more efficient ways of doing this as well, however the problem has not come up often enough for me to sit down and take the time to research how to use tab scopes correctly to avoid this workaround.

                這篇關于WPF 選項卡鍵導航的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                Parse malformed XML(解析格式錯誤的 XML)
                <legend id='NL037'><style id='NL037'><dir id='NL037'><q id='NL037'></q></dir></style></legend>

                <small id='NL037'></small><noframes id='NL037'>

                  <bdo id='NL037'></bdo><ul id='NL037'></ul>
                    <tbody id='NL037'></tbody>

                    <i id='NL037'><tr id='NL037'><dt id='NL037'><q id='NL037'><span id='NL037'><b id='NL037'><form id='NL037'><ins id='NL037'></ins><ul id='NL037'></ul><sub id='NL037'></sub></form><legend id='NL037'></legend><bdo id='NL037'><pre id='NL037'><center id='NL037'></center></pre></bdo></b><th id='NL037'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NL037'><tfoot id='NL037'></tfoot><dl id='NL037'><fieldset id='NL037'></fieldset></dl></div>
                      • <tfoot id='NL037'></tfoot>
                          主站蜘蛛池模板: 欧美一区二区三区在线观看视频 | 高清免费在线 | 国产精品欧美一区喷水 | 三级视频久久 | 中文字幕日韩三级 | 亚洲成av| 亚洲一区二区中文字幕在线观看 | 国产精品国产精品国产专区不片 | 国产成人综合网 | 日韩av在线一区 | 久久久久久看片 | 成人精品一区二区三区中文字幕 | 福利二区 | 国产一区二区三区免费 | 午夜影院在线观看免费 | 国产在线精品一区二区 | 久久久观看 | 国产剧情久久 | 日本a视频 | 日韩爱爱网 | 91大片| 一区二区在线不卡 | 欧美亚洲视频 | 国产成人精品在线播放 | 欧美二区在线 | 天天躁日日躁狠狠的躁天龙影院 | 日本在线一区二区三区 | 台湾a级理论片在线观看 | 国产精品一区二区日韩 | 91亚洲一区 | 伊色综合久久之综合久久 | www.色五月.com | 欧美在线播放一区 | www.日本在线观看 | 国产在线h | 国产一区二 | 国产精品久久久久一区二区 | 麻豆成人在线视频 | 国产传媒在线观看 | 久夜精品| 免费视频一区二区 |