This is a migrated thread and some comments may be shown as answers.

How to implement Scroll Bar to Micorsoft Control?

5 Answers 126 Views
ScrollBar
This is a migrated thread and some comments may be shown as answers.
Ray Wang
Top achievements
Rank 1
Ray Wang asked on 12 Nov 2009, 08:18 AM
Hi Telerik

Can you give us a example how to implement the scroll bar to the telerik and Micorsoft Control? We can't find it User manual.

And  when we try to use the telerik control, we found "flicker" is a big problem at many place. Do you have anu good solution to make the change between the different control more smooth?

Thank you

5 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 12 Nov 2009, 05:12 PM
Hello Ray,

Thanks for contacting us and for your interest in RadControls for WinForms.

I am not quite sure that I correctly understand your questions and the behavior you would like to achieve. Could you please share further details on your case so that we can provide you with proper answers to your questions?

I would also like to ask you which control you are using when experiencing flickering and in what scenario?

Thanks for your time. We look forward to receiving the details requested.
 

Regards,
Deyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ray Wang
Top achievements
Rank 1
answered on 13 Nov 2009, 02:26 AM
hi, Deyan
    I just want to add a radScroll Bar beside the listview which came from microsoft ,I want to keep the style of my GUI constantly ,so I replaced microsoft listview 's Scroll Bar with rad Scroll Bar,but the rad Scroll Bar didn't work ,and i want to know How to implement Scroll Bar to Micorsoft Control?
0
Deyan
Telerik team
answered on 17 Nov 2009, 02:45 PM
Hi Ray,

Thanks for getting back with me.

Basically, the behavior that you would like to implement is not an easy task. To integrate a separate scroll bar control with a ListView requires synchronization between the values of the RadScrollBar and the current scrolling position in the ListView, and vice-versa. These synchronizations are generally accomplished by inheriting from the control and intercepting some Win32 messages. You will also need to use several Win32 methods (GetScrollInfo, SetScrollInfo etc.) to achieve this task.

Could you also share with us how did you replace the standard Microsoft Scrollbar within the ListView control with ours?

Do you still experience flickering in any controls part of the RadControls for WinForms suite?

I look forward to receiving the details requested.

Thanks for your time and feel free to write back anytime you need assistance or have questions.

Regards,
Deyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ray Wang
Top achievements
Rank 1
answered on 18 Nov 2009, 02:20 AM

hi, Deyan 
thanks for your help and support
    i'm very sorry about that telerik can't provide the function of the Radlistview control which just like microsoft's listview,but i did want to need those function ,for example:details ,largeico,etc,so I replaced the radlistview with micosoft's listview.but when i implement the radscrollbar beside the microsoft's listview in order to keep the style constanstly,but it doesn't work , so i want to know how to implement the radscroll bar to any control which just like listview etc,and can u give me an example for this ,,and my code as following:

ListView filelistView  ; 
 private int pos = 0;
        private int endPos = 0; 
        private void radVScrollBar_ValueChanged(object sender, EventArgs e)
        {
            pos = radVScrollBar.Value;
            Win32API.SetScrollPos(filelistView.Handle, SB_VERT, pos, true);

            Win32API.PostMessage(filelistView.Handle, WM_VSCROLL, SB_THUMBPOSITION + 0x10000 * pos, 0);
        }

        private void radVScrollBar_Scroll(object sender, ScrollEventArgs e)
        {
            int PosV = Win32API.GetScrollPos(filelistView.Handle, 1);
            pos = radVScrollBar.Value + PosV;
            Win32API.SetScrollPos(filelistView.Handle, SB_VERT, pos, true);

            Win32API.PostMessage(filelistView.Handle, WM_VSCROLL, SB_THUMBPOSITION + 0x10000 * pos, 0);
        }
   [DllImport("user32.dll")]
        public static extern int GetScrollPos(IntPtr hwnd, int nBar);
[DllImport("user32.dll")]
        public static extern int SetScrollPos(IntPtr hwnd, int nBar, int nPos, bool bRedraw);
 [DllImport("user32.dll", SetLastError = true)]
        public static extern bool PostMessage(IntPtr hWnd, uint Msg, long wParam, int lParam);


many thanks

0
Deyan
Telerik team
answered on 23 Nov 2009, 08:15 AM
Hello Ray,

Thanks for getting back to me.

The approach that you are using is correct. However, I am not able to give you an example of how to integrate RadScrollBar into the standard ListView control since it is not related to our controls. In other words, we do not provide support on how to use the standard Windows controls.

You can take a look at MSDN for further information though. For example, you could use the WM_COMMAND message and the EN_VSCROLL/EN_HSCROLL notifications in order to update the RadScrollBar values when the user scrolls in the ListView.

The usage of the WM_COMMAND message is described here:

http://msdn.microsoft.com/en-us/library/ms647591(VS.85).aspx

Information about the EN_VSCROLL/EN_HSCROLL notifications can be found here:

http://msdn.microsoft.com/en-us/library/bb761689(VS.85).aspx
http://msdn.microsoft.com/en-us/library/bb761680(VS.85).aspx

I hope this is helpful.

Best wishes,
Deyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ScrollBar
Asked by
Ray Wang
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Ray Wang
Top achievements
Rank 1
Share this question
or