Is there a way to specify a size and custom image for the ScrollButtons of a UltraTabbedMdiManager?
I seem to be able to set the ScrollArrowStyle, the BackgroundColor en when to show the ScrollButtons, but not the size and image of them... (in the TabGroupSettings).
Thx, Lieven Cardoen
Hello Lieven,
There is no direct way to add images to the scroll buttons of UltraTabbedMdiManger. What you can do is add your images with custom DrawFilter. Regarding the size of the buttons this could be achieved by implementing a custom CreationFilter, but this will not be a trivial task as you will generally speaking recreate the entire control.
Attached is a small sample showing how you can set a background image for each button. Please check my sample and let me know if this is what you are looking for or if I am missing something.
MIko,
Thx for the quick answer. I'll try it out.
If I want a left arrow and a right arrow, do I have to pass two images to the draw filter? How do I do this?
thx, L.
Hi Lieven,
Yes, this is exactly what you should do. Send two images to the draw filter, then check the type of the button and assign the correct image. You can use code like this in DrawElement method:
SpinScrollButtonUIElement spinScrollButtonElement = drawParams.Element as SpinScrollButtonUIElement;if(spinScrollButtonElement != null){ if(drawPhase == DrawPhase.BeforeDrawForeground) return true; switch(spinScrollButtonElement.ScrollButtonType) { case System.Windows.Forms.ScrollButton.Left: drawParams.AppearanceData.ImageBackground = this.prevButtonImage; break; case System.Windows.Forms.ScrollButton.Right: drawParams.AppearanceData.ImageBackground = this.nextButtonImage; break; } drawParams.AppearanceData.ImageBackgroundStyle = ImageBackgroundStyle.Stretched;} return false;
Attached is a changed version of my sample, where I am setting different images for previous and next arrows.
Please, let me know if you need any further assistance with this matter.
Hi Milko,
Found this myself.
Thx for all the help.
Hi Milko, an image says more than a thousand words...
The Buttons now are 30px hight but 33px width. That's because I wanted a margin between both buttons of 6px.
So you have the TabRowUIElement, then 15px margin, then 30px button, then 6px space, then 30px button and then 15px margin again.
I managed to do this, but I will probably also have to Create the buttons myself?
ps: Can you also have a look at the question about drawfilter and isl file?
Thx!
I managed to resize the TabScrollButtonUIElement, but is there a way to control the size of the buttons seperately?
For instance, now the buttons are 30x30 pixels and centered, but they stick to each other. There's no margin between the buttons...
I find it difficult to get the difference between the DrawFilter and the CreationFilter. Should I add a third UIElement check in the CreationFilter? (Button or something).
+ If you use a DrawFilter, does the isl file still apply?
thx, Lieven
You can achieve this by implementing custom Creation Filter. Attached is a sample showing how you can change the size of the images. Keep in mind the intention of this sample is to show you how to set the buttons’ sizes only in this scenario. If you have some other configuration, e.g. vertical tab groups, you will need to change this creation filter.
Please let me know if you have any additional questions.
ScreenShot:
They seem identical, but they are custom images.
They should however be 30x30px (that's their size).
Thx, Lieven