Results 1 to 6 of 6

Thread: [RESOLVED] Custom control enhancement

  1. #1

    Thread Starter
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Resolved [RESOLVED] Custom control enhancement

    http://www.codeproject.com/KB/cpp/mclb.aspx

    I have the above control I am using, whose base class is the ListBox.
    Unlike the ListBox, it doesn't highlight a new item when it is inserted.
    I already had to add the ability to InsertAt() a new item since the person who made it originally hadn't implemented that part.

    But, I am having trouble figuring out how to make that part work.
    The above link is directly to the original Control.

    Here is the code for the Insert method I added:

    Code:
        Public Sub Insert(ByVal index As Integer, ByVal value As MCListBoxItem)
            Try
                List.Insert(index, value)
                _c += 1
                RaiseEvent Changed()
            Catch ex As Exception
                MsgBox("Insert")
            End Try
        End Sub
    Anyone out there that can help me with this would be greatly appreciated.
    I am currently changing the selectedindex in my program but would much rather it be handled in the control.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

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

    Re: Custom control enhancement

    I don't quite understand the question. You have an Insert method, which is what you want. What is the actual question? If that method doesn't work as you want then please describe exactly what you want to happen and exactly what does happen.
    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
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Custom control enhancement

    "Unlike the ListBox, it doesn't highlight a new item when it is inserted."

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

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

    Re: Custom control enhancement

    Quote Originally Posted by Seraph View Post
    "Unlike the ListBox, it doesn't highlight a new item when it is inserted."
    The way that you've written your post indicates that that is a desirable feature of the original control, not an undesirable feature of your modified version.
    I have the above control I am using, whose base class is the ListBox.
    Unlike the ListBox, it doesn't highlight a new item when it is inserted.
    I suggest reading your post before submitting and pretending you have no prior knowledge of the problem.

    Apart from that, the standard ListBox control doesn't highlight a new item when it's inserted anyway, so that's also a source of confusion.
    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

  5. #5

    Thread Starter
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    Re: Custom control enhancement

    bah..nevermind...
    you're right, it doesn't.
    I did it in my code.
    I forgot I did that and was thinking that the ListBox itself does that.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

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

    Re: [RESOLVED] Custom control enhancement

    __
    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