Results 1 to 6 of 6

Thread: Windows form (and controls) focus question

  1. #1

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    384

    Windows form (and controls) focus question

    Hi all, O7.

    Consider you want to double click on a line through lots of lines and you want the software to get you on the corresponding control location and tells you "here it is" with no words. Kind of flicker it once or twice. Formerly we focus the control but not all of them respond as obvious as text boxes. What I need is much like "emphasis" reaction on a dialogbox where despite clicking somewhere else is prohibited but it "dings" and attracts all user's attention to its flickers a short time. (What does thing even called?)

    Ho can we achieve such behavior?

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Windows form (and controls) focus question

    Hi Puka O7.
    What is a line?
    If it has properties that you can set them maybe...
    Create an array and map the controls by p.e. name.
    Manage the specific lines you want to navigate to controls. When line click access the control from Form.Controls and the do what you want to the control.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    384

    Re: Windows form (and controls) focus question

    Quote Originally Posted by sapator View Post
    Puka
    Esy eisai pali...

    Lines like items of a ListBox or rows of a DataGridView, as you double click on them based on their containing value, the goal is to direct you to a specific control and perform flicker on them.

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Windows form (and controls) focus question

    Same principal.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  5. #5
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,508

    Re: Windows form (and controls) focus question

    You need to be more specific. Different controls would have different methods. If it was a Combobox I'd store the control name in the Selected value property. You could draw attention to the control by blinking it a few times. That's easily done using a timer.

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

    Re: Windows form (and controls) focus question

    For the drawing attention to a control, alternating two states would be done with a Timer, as suggested above. You would Start the Timer and, on each Tick, you would toggle the state. It's completely up to you what that state is. You might change the BackColor but any visual property might do the job. The smaller the Interval you use, the quicker the toggling would take place. You would count the number of Tick events and then Stop the Timer after an appropriate number, e.g. 6.

    As for how to specify the control to focus and perform the toggling on, that really depends on the source, as suggested. You need to be far more specific about what you actually have and what you're actually trying to achieve. If there were some common mechanism for this, you probably wouldn't have had to ask the question in the first place. The control you're clicking, the data it contains and how that relates to the target control is all important information.
    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

Tags for this Thread

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