Results 1 to 3 of 3

Thread: SelectNextControl in UserControl, not working? [2.0]

  1. #1

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Arrow SelectNextControl in UserControl, not working? [2.0]

    It seem so, when I tried it with the Textbox control it's working, but it doesn't seem to be when used in a UserControl inheriting a Textbox...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: SelectNextControl in UserControl, not working? [2.0]

    Can you show us the code you're using? SelectNextControl is supposed to shift focus to the next control in the tab order. is that what you're trying to do? I'm not sure but I think it will also only select controls with TabStop set to True, or at leats by default. Does that sound like it would make any difference. Also, is this a UserControl or not? A UserControl inherits UserControl, while an inherited TextBox would be considered a custom control. If you have a UserControl that doesn't expose its constituent controls publicly then I'm not sure how SelectnextControl would behave. You'd think that it would still visit every control but I'm not sure.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: SelectNextControl in UserControl, not working? [2.0]

    You may call it custom control since I just added a UserControl then replaced the inheritance with Textbox. I don't the code right now but its something like...

    Code:
    SelectNextControl(sender as TextBox, true, true, true, true)
    Not sure how many true are there but I have set all the boolean parameters to true, with an ordinary textbox it's working but not with the custom control. And when I try Sendkeys("Tab") it's working though I don't want to use SendKeys, it's just weird...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

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