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

Hide Toolbar on left hand side

12 Answers 456 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Romel
Top achievements
Rank 1
Romel asked on 22 Jun 2018, 06:53 PM

Hi all,

I just downloaded the Telerik UI for Winforms 2018_2_621 and started "tinkering" around with the RadImageEditor control for a specific project I am currently working on for work. I was wondering, is there a way to "hide" or "disable" the buttons on the toolbar on the left hand side of the image editor? Or (perhaps the most ideal for me) is there a way to completely hide the toolbar altogether on the left hand side?

I thought this would be a simple "enable" or "disable" on a property of the control, but I can't seem to find any documentation on this matter. Thank you and I look forward to the response.

12 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Jun 2018, 10:32 AM
Hello, Romel,   

In order to hide completely the left toolbar of RadImageEditor, you should simply set the ImageEditorElement.CommandsElement.Visibility property to Collapsed.

this.radImageEditor1.ImageEditorElement.CommandsElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;

I hope this information helps. If you have any additional questions, please let me know. 

Regards,
Dess
Progress TelerikRadImageEditor for Winforms
0
Romel
Top achievements
Rank 1
answered on 25 Jun 2018, 03:27 PM

Hi, thank you very much for the reply. That worked great. Now, there was a change in requirements and it may seem to be more easier if I only hide certain elements in the tool bar, would that be possible? I seem to be to get access to the top 4 buttons(undo, redo, open, save) on the tool bar by doing something like this:

this.radImageEditor1.ImageEditorElement.CommandsElement.UndoButton.Visibility = ElementVisibility.Collapsed;

How do I get access to the other buttons on the "Transform" section? I would also prefer to just completely hide the "Adjust" and "Effects" section, as I don't see a need for this for us.

Thanks again very much and I look forward to your response.

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Jun 2018, 06:50 AM
Hello, Romel,   

All menu items on the left commands panel are stored in the ImageEditorElement.CommandsElement.CommandsStackElement. In order to hide any item you wish, it is necessary to iterate its Children collection and change the Visibility of the respective item. Here is a sample code snippet demonstrating how to hide completely the "Resize" and "Crop" items:
foreach (var item in this.radImageEditor1.ImageEditorElement.CommandsElement.CommandsStackElement.Children)
{
    RadMenuItem menuItem = item as RadMenuItem;
    if (menuItem != null && (menuItem.Text == "Resize"||menuItem.Text=="Crop"))
    {
        menuItem.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
    }
}

I hope this information helps. If you have any additional questions, please let me know. 

Regards,
Dess
Progress TelerikRadImageEditor for Winforms
0
Romel
Top achievements
Rank 1
answered on 27 Jun 2018, 03:34 PM

Dess, thank you once again. The code snippet worked well for me. Is there a documentation I can view somewhere besides the one on the Telerik/Progress website? The one on the website does not seem to provide enough info about the Image Editor, and only contains "basic" simple documentation on it.... =) I suspect that this is because the tool is still quite new? Anyways, thanks again and if you can point me to a better documentation, that would be great.

I have another question on the image editor, but I started a new thread for that since it is on a different behavior/functionality. Thanks

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Jun 2018, 09:39 AM
Hello, Romel,   

The provided feedback it greatly appreciated. We will consider improving the documentation related to RadImageEditor. However, it would be greatly appreciated if you can share with us what kind of information to be included. We always strive to consider our customers' feedback in order to update the official resources accordingly.

In addition, note that our Demo application is also an official resource which demonstrates the features of each control in our suite. It can be found in the installation folder of the suite at the following path: C:\Program Files (x86)\Progress\Telerik UI for WinForms R2 2018\Examples\QuickStart\Bin

I hope this information helps. If you have any additional questions, please let me know. 

Regards,
Dess
Progress TelerikRadImageEditor for Winforms
0
Michael
Top achievements
Rank 1
answered on 16 Jun 2020, 06:34 AM

Hi,

i hided the left toolbar and the zoom bar completely with your code above.
If I start the Programm, the toolbar and the Zoom bar are hidden but the space is reserved for them.

Is it possible to resize the Picture Element to use the complete Space of the control?

0
Michael
Top achievements
Rank 1
answered on 17 Jun 2020, 05:45 AM

Found it in the Docs

RadImageEditorElement.CommandsElementWidth = 0

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Jun 2020, 10:37 AM

Hi, Michael,

I am glad that you have found a suitable solution for your case.

Indeed, the RadImageEditorElement.CommandsElementWidth property is the suitable approach for manipulating the size of the left panel.

Note that most of the forum threads are reviewed by Telerik representatives and sometimes we address the questions asked by our customers in the forums as well. However, a post in the forum doesn't guarantee you a response from the Telerik support team. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread. Thank you for your understanding.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Jay
Top achievements
Rank 1
answered on 10 Jul 2020, 10:10 AM

This gets the individual items but does not remove the sections.

Transform,Adjust,Effects

I would like remove Adjust and Effects. It looks stupid with Adjust and Effects with no items.

Thanks,Jay

 

0
Nadya | Tech Support Engineer
Telerik team
answered on 10 Jul 2020, 11:31 AM

Hi, Jay,

Please refer to the following code snippet in order to remove the header items as well:

foreach (var item in this.radImageEditor1.ImageEditorElement.CommandsElement.CommandsStackElement.Children)
{
    RadMenuHeaderItem menuItem = item as RadMenuHeaderItem;
    if (menuItem != null && (menuItem.Text == "Adjust" || menuItem.Text == "Effects"))
    {
        menuItem.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
    }
}

I hope this helps. Do not hesitate to ask if you have other questions.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Jay
Top achievements
Rank 1
answered on 15 Jul 2020, 12:13 PM

Since you asked. I would like to add a zoom in and zoom out button on my form. So when I click zoom in it will zoom in 10 percent. I started doing the math but if you already have an example I would appreciate it.

FYI - I am doing it in vb.net and I tried to use https://converter.telerik.com/ to convert your code above and it would not convert. I was able to do it manually. Just thought you may want to look into why Telerik's converter doesn't work.

Thanks,

Jay

0
Nadya | Tech Support Engineer
Telerik team
answered on 16 Jul 2020, 01:53 PM

Hello, Jay,

According to your first question about how to implement zooming on a form, it is more like a general programming question and it is not actually related to our controls. Feel free to search in the relevant forums if you have any further questions on this topic. Here is a forum thread where a similar question was discussed: https://stackoverflow.com/questions/35537/zoom-for-a-windows-form-in-c-sharp

As to your second question, here is the code in VB:

    For Each item In Me.radImageEditor1.ImageEditorElement.CommandsElement.CommandsStackElement.Children
        Dim menuItem As RadMenuHeaderItem = TryCast(item, RadMenuHeaderItem)
        If menuItem IsNot Nothing AndAlso (menuItem.Text = "Adjust" OrElse menuItem.Text = "Effects") Then
            menuItem.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
        End If
    Next

Note, that Telerik Converter works fine when you convert methods instead of separate code snippets like for each loop.

I hope this information helps.

Regards,
Nadya
Progress Telerik

Tags
ImageEditor
Asked by
Romel
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Romel
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Jay
Top achievements
Rank 1
Nadya | Tech Support Engineer
Telerik team
Share this question
or