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

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

  1. <legend id='z6ErO'><style id='z6ErO'><dir id='z6ErO'><q id='z6ErO'></q></dir></style></legend>
    <i id='z6ErO'><tr id='z6ErO'><dt id='z6ErO'><q id='z6ErO'><span id='z6ErO'><b id='z6ErO'><form id='z6ErO'><ins id='z6ErO'></ins><ul id='z6ErO'></ul><sub id='z6ErO'></sub></form><legend id='z6ErO'></legend><bdo id='z6ErO'><pre id='z6ErO'><center id='z6ErO'></center></pre></bdo></b><th id='z6ErO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='z6ErO'><tfoot id='z6ErO'></tfoot><dl id='z6ErO'><fieldset id='z6ErO'></fieldset></dl></div>
    <tfoot id='z6ErO'></tfoot>
      <bdo id='z6ErO'></bdo><ul id='z6ErO'></ul>
    1. C# .NET Compact Framework,自定義 UserControl,焦點問題

      C# .NET Compact Framework, custom UserControl, focus issue(C# .NET Compact Framework,自定義 UserControl,焦點問題)

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

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

          • <tfoot id='LCTik'></tfoot>

                本文介紹了C# .NET Compact Framework,自定義 UserControl,焦點問題的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我有一個自定義 UserControl(一個標簽和一個文本框).

                I have a custom UserControl (a label and a textbox).

                我的問題是我需要處理按鍵按下、按鍵向上事件以在表單中的控件之間導航 (.NET Compact Framework 文本框、組合框等).使用 .NET Compact Framework 框架提供的控件,它可以工作,但是當我到達我編寫的用戶控件時,該控件沒有獲得焦點(里面的文本框獲得焦點)所以從這個用戶控件我無法導航,因為在面板中我無法控制誰擁有焦點.

                My problem is I need to handle the key down, key up events to navigate between controls in the form (.NET Compact Framework textbox, combobox, etc). With the controls provided by the .NET Compact Framework framework it works, but when I reach a usercontrol written by me, that control don`t get focus (the textbox inside get the focus) so from this usercontrol I cannot navigate because in the panel I don't have any control of who have focus.

                一個小模型:Form->Panel->controls-> on keydown event (使用 KeyPreview) with a foreach 我檢查面板上有焦點的控件并使用 SelectNextControl 傳遞給下一個控件,但沒有人有焦點,因為 usercontrol 沒有獲得焦點...

                A little mock up : Form->Panel->controls -> on keydown event (using KeyPreview) with a foreach I check what control have focus on the panel and pass to the next control with SelectNextControl, but no one have focus because the usercontrol don`t got focus...

                我試圖處理文本框 gotFocus 事件并將焦點放在用戶控件上,但我得到了一個無限循環..

                I tried to handle the textbox gotFocus event and put focus to the user control, but I got an infinite loop..

                有人知道我能做什么嗎?

                Does somebody have any idea what can I do?

                推薦答案

                我們在 Compact Framework 上做了完全相同的事情,添加了一個全局焦點管理器,支持使用鍵盤輸入在控件之間導航.

                We've done the exact same thing on Compact Framework, adding a global focus manager that supports navigating between controls using keyboard input.

                基本上,您需要做的是向下遞歸控件樹,直到找到具有焦點的控件.它的效率不是很高,但只要每個關鍵事件只執行一次,這應該不是問題.

                Basically, what you need to do is to recurse down the tree of controls until you find a control that has focus. It's not terribly efficient, but as long as you only do it once per key event, it shouldn't be an issue.

                為我們的遞歸焦點查找函數添加了代碼:

                Added the code for our recursive focus finding function:

                public static Control FindFocusedControl(Control container)
                {
                    foreach (Control childControl in container.Controls) {
                        if (childControl.Focused) {
                            return childControl;
                        }
                    }
                
                    foreach (Control childControl in container.Controls) {
                        Control maybeFocusedControl = FindFocusedControl(childControl);
                        if (maybeFocusedControl != null) {
                            return maybeFocusedControl;
                        }
                    }
                
                    return null; // Couldn't find any, darn!
                }
                

                這篇關于C# .NET Compact Framework,自定義 UserControl,焦點問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                Calling A Button OnClick from a function(從函數調用按鈕 OnClick)
                ASP.net C# Gridview ButtonField onclick event(ASP.net C# Gridview ButtonField onclick 事件)
                Adding OnClick event to ASP.NET control(將 OnClick 事件添加到 ASP.NET 控件)
                Multiple submit Button click problem?(多個提交按鈕點擊問題?)
                • <tfoot id='xlmug'></tfoot>

                      <tbody id='xlmug'></tbody>
                        <bdo id='xlmug'></bdo><ul id='xlmug'></ul>
                          <legend id='xlmug'><style id='xlmug'><dir id='xlmug'><q id='xlmug'></q></dir></style></legend>

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

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

                          主站蜘蛛池模板: 黑人巨大精品欧美黑白配亚洲 | www.国产精| 欧美精品福利视频 | 日韩欧美在线不卡 | 亚洲欧美日本在线 | 免费观看黄a一级视频 | 性在线| 欧美激情va永久在线播放 | 天天色天天射天天干 | 黑人巨大精品欧美一区二区免费 | 免费国产一区二区视频 | 欧美一区二区免费 | 国产精品成人69xxx免费视频 | www久久爱 | 成人性生交大片免费看r链接 | 国产男女猛烈无遮掩视频免费网站 | 成人午夜在线观看 | 国产亚洲一区二区三区在线 | 日本公妇乱淫xxxⅹ 国产在线不卡 | 91国产视频在线 | 狠狠亚洲| 久久天天| 自拍偷拍亚洲视频 | 精品一二区 | 欧美成人一级 | 国产女人与拘做视频免费 | 一区二区三区四区在线播放 | 七七婷婷婷婷精品国产 | 欧美精品在线一区二区三区 | 国产精品99久久久久久宅男 | 99热碰 | 欧美成年黄网站色视频 | 国产免费av在线 | 欧美一区二不卡视频 | 国产一区二区三区 | 黑人久久 | 婷婷综合网 | 国产精品高潮呻吟久久 | 久久国产成人 | 日韩高清国产一区在线 | 国产日产精品一区二区三区四区 |