Results 1 to 4 of 4

Thread: [2005] Change tabpage title when user starts editing

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    83

    Question [2005] Change tabpage title when user starts editing

    Hi all & very good morning!

    I have something extra to implement in my form.
    You know when you change something in your code in VS, the tab gets a '*' added at the end?
    Well, I'd like to do something like that.

    I have 4 tabpages; 1 tabpage contains the parent details (textboxes,combobox, etc) and another 3 tabpage with different datagridview.
    I'd like the title of the tabpage to change as soon as the user enter something into the controlfield.

    What i have so far in my code is not right. I'm sure not implementing the right event for this because when I step through, it didn't go. My questions are:

    1) How to know if the user is editing any of the control fields in a tabpage
    2) The ideal event to implement this.

    Thanks in advance for your time.
    Last edited by rim78; Feb 6th, 2007 at 11:23 PM.

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

    Re: [2005] Change tabpage title when user starts editing

    It will completely depend on the type of control(s). For a TextBox it would be TextChanged, for a ComboBox it would be SelectedIndexChanged or similar, etc., etc.
    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
    Lively Member
    Join Date
    Jun 2006
    Posts
    83

    Re: [2005] Change tabpage title when user starts editing

    Hi jm

    Yeah i saw that in the msdnlibrary and tried textbox1_textchanged event but it changes the tabpage title as soon as the form loads. and the title also change when i navigate through the records even when user didn't enter anything yet.

    Hmm

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

    Re: [2005] Change tabpage title when user starts editing

    The TextChanged event of a TextBox is raised whenever the value of the Text property changes. Loading your data and navigating records will cause the Text property to change so the event is raised. It's up to you to allow for that. You could handle the RowChanged event of the underlying DataTable instead, but that is only raised when the new value is validated and sent to the table. That won't be until the user leaves a field they just edited.
    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

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