Results 1 to 9 of 9

Thread: [RESOLVED] [1.0/1.1] .net cf ShowDialog problem.

  1. #1

    Thread Starter
    Hyperactive Member babyekc's Avatar
    Join Date
    Jul 2004
    Location
    planet earth
    Posts
    270

    Resolved [RESOLVED] [1.0/1.1] .net cf ShowDialog problem.

    Hey guys,

    I got a simple form1, which has a button1. When i click button1, it then open another form, which is form2, by using ShowDialog method. When i close the form2, i set the focus to form1. But the focus remains in button1. even if i have another button2, which i click on it (no code), i supposed the focus is on button2, but it eventually goes back to button1. how is this suppose to be? the focus is remain to a particular button after ShowDialog is fired.

    need help urgently. thanks.
    *wink wink*

    _babyekc

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [1.0/1.1] .net cf ShowDialog problem.

    Check your tab order. What is the TabIndex for each button?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Hyperactive Member babyekc's Avatar
    Join Date
    Jul 2004
    Location
    planet earth
    Posts
    270

    Re: [1.0/1.1] .net cf ShowDialog problem.

    im soree because this is an mobile app. can u move this thread to mobile forum?
    *wink wink*

    _babyekc

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [1.0/1.1] .net cf ShowDialog problem.

    Oh Ok.

    Thread Moved
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Hyperactive Member babyekc's Avatar
    Join Date
    Jul 2004
    Location
    planet earth
    Posts
    270

    Re: [1.0/1.1] .net cf ShowDialog problem.

    anyone has any idea?
    *wink wink*

    _babyekc

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: [1.0/1.1] .net cf ShowDialog problem.

    I don't see what the problem is. If you click on a button, and in the button click event another form is shown with ShowDialog, then when that second form goes away, it makes sense for the focus to return to the button. Where else would it be?
    My usual boring signature: Nothing

  7. #7

    Thread Starter
    Hyperactive Member babyekc's Avatar
    Join Date
    Jul 2004
    Location
    planet earth
    Posts
    270

    Re: [1.0/1.1] .net cf ShowDialog problem.

    Shaggy Hiker,

    yea, it makes 100 senses after button click event and the form goes away, the focus return to the button itself. but my problem is, i wan to set the focus to another control, but it just remain in the button itself. even i click another button/combobox/textbox, the focus is still remain in the button itself.
    *wink wink*

    _babyekc

  8. #8
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: [1.0/1.1] .net cf ShowDialog problem.

    Normally, you'd use Button2.Focus() to set the focus to the second button, but you say that the focus will switch back on it's own. That seems kind of odd. Is there anything that specifically sets the focus to the first button?
    My usual boring signature: Nothing

  9. #9

    Thread Starter
    Hyperactive Member babyekc's Avatar
    Join Date
    Jul 2004
    Location
    planet earth
    Posts
    270

    Re: [1.0/1.1] .net cf ShowDialog problem.

    yes, to set the focus after using showdialog method make me sick.
    *wink wink*

    _babyekc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width