Download MetaTrader 5

Discussion of article "MQL5 Cookbook: Indicator Subwindow Controls - Scrollbar"

To add comments, please log in or register
Use searching on It is easy!
MetaQuotes Software Corp.
MetaQuotes Software Corp. 2013.11.07 06:47 

New article MQL5 Cookbook: Indicator Subwindow Controls - Scrollbar has been published:

Let's continue exploring various controls and this time turn our attention to scrollbar. Just like in the previous article entitled "MQL5 Cookbook: Indicator Subwindow Controls - Buttons", all operations will be performed in the indicator subwindow. Take a moment to read the above mentioned article as it provides a detailed description of working with events in the OnChartEvent() function, while this point will only be casually touched upon in this article. For illustrative purposes, this time around we will create a vertical scrollbar for a large list of all financial instrument properties that can be obtained using MQL5 resources.

In the previous articles on MQL5 programming we used the graphical object OBJ_LABEL (Text Label) to create lists. In this article, we will use a canvas to display text. The convenience of such approach lies in that instead of a great number of OBJ_LABEL objects, we will only use one - OBJ_BITMAP_LABEL (Bitmap Label). You can draw any interface elements on a canvas but this time we will limit ourselves to text only.

The scrollbar will be very simple. It usually has arrow buttons but they will not be features in our case. The scrollbar will only consist of the background and scroll box. The scroll box will change its color when the cursor goes over it. When clicked, it will also change color suggesting to the user that the scroll box is now selected and can be dragged. In creating scrolling objects, we will use graphical objects of the OBJ_RECTANGLE_LABEL (Rectangle Label) type.

MQL5 Cookbook: Indicator Subwindow Controls - Scrollbar

Author: Anatoli Kazharski

Muhammad Syamil Bin Abdullah
Muhammad Syamil Bin Abdullah 2013.12.01 13:43  
Recently i have following all article from Anatoli and i must say he is a great coder. Furthermore he share his knowledge with others that new to MT5 programming language, like me, which i think is a generous move. I hope in future more articles will be publish by Anatoli.
To add comments, please log in or register