Focus issue on Form Load

前端 未结 2 1892
你的背包
你的背包 2021-01-29 05:32

I have an ActiveX control (written in VB 6.0 or C++ maybe) that we are using as an AxInterop in a C# WinForms program. It is very much like a text box but with some special logi

2条回答
  •  情话喂你
    2021-01-29 05:57

    Are you sure the component is visible when you try to give it focus?

    If you are trying to do the focussing in a Form.Load event handler, try moving it to the Form.Shown handler instead, or perhaps Control.Enter.

    The difference in behaviour could be down to a timing issue. Have a look on MSDN for the order in which events occur on an opening form for more ideas.

提交回复
热议问题