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

toolWindow alignment

5 Answers 75 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 21 Aug 2018, 07:15 PM

How do I align the text in the header of a ToolWindow - See attached image

I tried following the steps here https://www.telerik.com/forums/problem-by-raddock-a8623cc5b85c but I am not getting the same results.

Note that I am using Telerik with Progress for .NET

Thanks

 

5 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 22 Aug 2018, 09:05 AM
Hello Terry,

The following code shows how you can set the text alignment:
var textElement = ((ToolTabStrip)this.toolWindow1.TabStrip).CaptionElement.FindDescendant<TextPrimitive>();
if (textElement != null)
{
    textElement.TextAlignment = ContentAlignment.MiddleCenter;
}

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Terry
Top achievements
Rank 1
answered on 24 Aug 2018, 05:17 AM

Thanks Dimitar,

I am developing our code using the Progress ABL, and unfortunately generics are not supported in the ABL. (https://knowledgebase.progress.com/articles/Article/000057503?q=generics&l=en_US&fs=Search&pn=1)

Is it possible to provide sample code that does not use generics?

Thanks

0
Dimitar
Telerik team
answered on 24 Aug 2018, 08:18 AM
Hi Terry,

You can directly access the text element. Here is the code:
var textElement = ((ToolTabStrip)this.toolWindow1.TabStrip).CaptionElement.Children[2].Children[3] as TextPrimitive;
if (textElement != null)
{
    textElement.TextAlignment = ContentAlignment.MiddleCenter;
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Terry
Top achievements
Rank 1
answered on 27 Aug 2018, 10:44 PM

Awesome! Thanks so much it worked,  This is the equivalent in the Progress ABL

   DEFINE VARIABLE txtElement AS Telerik.WinControls.Primitives.TextPrimitive NO-UNDO.
   txtElement = CAST(CAST(THIS-OBJECT:twHistory:TabStrip, ToolTabStrip):CaptionElement:Children[2]:Children[3], Telerik.WinControls.Primitives.TextPrimitive).
   if VALID-OBJECT(txtElement) THEN
      txtElement:TextAlignment = Telerik.WinControls.ContentAlignment:MiddleCenter.

0
Dimitar
Telerik team
answered on 28 Aug 2018, 09:13 AM
Hi Terry,

Thank you for sharing this. Do not hesitate to contact us if you have other questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Dock
Asked by
Terry
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Terry
Top achievements
Rank 1
Share this question
or