Results 1 to 6 of 6

Thread: Modeless Progress Bar Help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Angry Modeless Progress Bar Help

    hi
    im just been browsing the internet for modeless prograss bar like the one in my documents (See Photo)


    i want to create my progress bar like that through a combobox search for my application can anyone help me

    thanks
    pillhead2007

  2. #2
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Re: Modeless Progress Bar Help

    This is from the top of my head, but you could override the paint process of the combobox, so that the background will be painted every time 1% is completed.
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

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

    Re: Modeless Progress Bar Help

    I'm afraid that it's not going to be simple. The ComboBox doesn't support custom drawing. I think you'd have to use some involved API calls, exactly which I don't know.
    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

  4. #4
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Re: Modeless Progress Bar Help

    But, can't you just repaint the background of the CB?
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

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

    Re: Modeless Progress Bar Help

    Quote Originally Posted by tassa View Post
    But, can't you just repaint the background of the CB?
    The ComboBox.Paint event is hidden from the designer because it's not supported. I just tried this:
    vb.net Code:
    1. Public Class ComboBoxEx
    2.     Inherits ComboBox
    3.  
    4.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
    5.         MyBase.OnPaint(e)
    6.  
    7.         e.Graphics.DrawRectangle(Pens.Blue, 0, 0, 25, 25)
    8.     End Sub
    9.  
    10.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
    11.         MyBase.OnPaintBackground(pevent)
    12.  
    13.         pevent.Graphics.DrawRectangle(Pens.Red, 0, 0, 25, 25)
    14.     End Sub
    15.  
    16. End Class
    and placed an instance on a form and saw no blue or red square. As I said:
    The ComboBox doesn't support custom drawing.
    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

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jul 2009
    Posts
    150

    Re: Modeless Progress Bar Help

    so if you do come across this way of modeless progress bar like that one there for a combobox please update thread and thanks for the info thanks

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