Standard Scrollbar (HELP) ... 
Author Message
 Standard Scrollbar (HELP) ...

   Is it possible to change the graphics in a standard ScrollBar (that is :
changing its appearance) ?


                                - Athos.

Thu, 30 Dec 2004 02:10:27 GMT  
 Standard Scrollbar (HELP) ...
Hello Athos,

I am afraid there is not an easy way to customize a ScrollBar control
provided by .NET Framework. You may derive a new class from the ScrollBar,
and draw all things by yourself in the OnPaint method. Two things should
pay attention to:

1.      You should set the Control's UserPaint style to true to enable the
2.      You should draw all items in the method, event you call the base's
OnPaint method.

This is a sample code:

public class MyScrollBar : System.Windows.Forms.HScrollBar
        public MyScrollBar()
                this.SetStyle(ControlStyles.UserPaint, true);

        protected override void OnPaint(PaintEventArgs e)
                //Perform your drawing here


I hope it is helpful.

Best regards,

Lion Shi, MCSE, MCSD
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.  2001 Microsoft Corporation. All rights

    Subject: Standard Scrollbar (HELP) ...
    Date: Sat, 13 Jul 2002 20:10:27 +0200
    Lines: 10
    X-Priority: 3
    X-MSMail-Priority: Normal
    X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

    Newsgroups: microsoft.public.dotnet.languages.CSharp
    Path: cpmsftngxa07!tkmsftngp01!tkmsftngp08
    Xref: cpmsftngxa07 microsoft.public.dotnet.languages.csharp:75500
    X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

       Is it possible to change the graphics in a standard ScrollBar (that
is :
    changing its appearance) ?


                                    - Athos.

Sat, 01 Jan 2005 13:59:19 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Horizontal Scrollbar Controls in VC++6 (Standard, Academic)

2. Show standard scrollbar of a window.

3. ClistCtrl ScrollBar and ScrollBar range

4. Help about ScrollBar

5. Help on writing scrollbar control please

6. HELP: Scrollbar in a Dialog

7. Please help me about Scrollbar

8. Please help me about ScrollBar

9. Scrollbar position help

10. help with scrollbar control

11. Help: Left-Aligned Scrollbar in CScrolView?

12. Standard C using Standard C


Powered by phpBB® Forum Software