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

RadForm add Visual Studio 2017 QuickStart on TitleBar

14 Answers 144 Views
TitleBar
This is a migrated thread and some comments may be shown as answers.
Leandro
Top achievements
Rank 1
Leandro asked on 06 Sep 2018, 04:05 AM

     Hey guys, I'm trying to add a QuickStart(TextBox with Autocomplete) to the Title Bar, like visual studio 2017. I've tried adding a RadTextBoxElement, but I couldn't even enter text on it, any help? But of course I wanna it beatiful, like Visual Studio, changing border colors and back color. I've attached how it is on VS and how it is on mine.

The button is a RadButtonElement.

14 Answers, 1 is accepted

Sort by
0
Leandro
Top achievements
Rank 1
answered on 09 Sep 2018, 03:24 PM
Is there a way to achieve that? I'm trying several ways, but whitout sucess
0
Dimitar
Telerik team
answered on 10 Sep 2018, 08:42 AM
Hi Leandro,

This cannot be achieved with RadForm. What you can do is use ShappedForm with RadTitleBar. Here is an example:
public partial class Form1 : ShapedForm
{
    public Form1()
    {
        InitializeComponent();
        var textbox = new RadTextBoxControlElement();
        textbox.Text = "Test";
        textbox.MinSize = new Size(100, 0);
 
        this.radTitleBar1.TitleBarElement.SystemButtons.Children.Insert(0, textbox);
    }
}

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
Leandro
Top achievements
Rank 1
answered on 11 Sep 2018, 12:33 AM
Ok, I could get it working, but the only problem is the icon of the form, is showing ugly as possible
0
Dimitar
Telerik team
answered on 11 Sep 2018, 07:41 AM
Hi Leandro,

Could you try setting the icon like this and let me know the results:
this.radTitleBar1.TitleBarElement.IconPrimitive.Image = Image.FromFile(@"C:\img\delete.png");

Does this look in a similar way on a regular RadForm or the default form?

I am looking forward to your reply.
 
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.
0
Leandro
Top achievements
Rank 1
answered on 11 Sep 2018, 11:30 PM

yeah, setting directly from Icon file works too, just setting from designer looks awful.

 

this.Icon = Properties.Resources.favicon;
 this.radTitleBar1.TitleBarElement.IconPrimitive.Image = Properties.Resources.favicon.ToBitmap();
0
Accepted
Dimitar
Telerik team
answered on 12 Sep 2018, 06:36 AM
Hi Leandro,

I am glad that this works well now. Do not hesitate to contact us if you have other 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
Leandro
Top achievements
Rank 1
answered on 15 Sep 2018, 02:43 PM

Well, there is another problem I can't fix, I can't add any buttonElement if I add autocompletetextbox. the autocomplete goes behind everything. On any position

 

txtAutoComplete = new RadAutoCompleteBoxElement();
            txtAutoComplete.NullText = "[Ctrl + SHIFT + A] Atalhos: Digite aqui qual(is) tela(s) deseja abrir...";
            txtAutoComplete.MaxDropDownItemCount = 20;
            txtAutoComplete.TokenValidating += TxtAutoComplete_TokenValidating;
                 
            txtAutoComplete.MinSize = new System.Drawing.Size(450, 0);
            this.radTitleBar1.TitleBarElement.SystemButtons.Children.Insert(0, txtAutoComplete);
 
 
            var btnMaximizar = new RadButtonElement();
            btnMaximizar.Text = "FullScreen";
            this.radTitleBar1.TitleBarElement.SystemButtons.Children.Insert(0, btnMaximizar);
0
Leandro
Top achievements
Rank 1
answered on 18 Sep 2018, 01:02 AM
Ok, could get that working by simple adding the autocomplete inside a
StackLayoutElement stack = new StackLayoutElement();
 stack.Orientation = Orientation.Horizontal;
 txtAutoComplete = new RadAutoCompleteBoxElement();
 stack.Children.Add(txtAutoComplete);
 this.radTitleBar1.TitleBarElement.SystemButtons.Children.Insert(0, stack);
var btnMaximizar = new RadImageButtonElement();
 btnMaximizar.MaxSize = new Size(radTitleBar1.TitleBarElement.MinimizeButton.Size.Width, 0);
 btnMaximizar.ToolTipText = "Tela Cheia";
 btnMaximizar.Text = "FullScreen";
 this.radTitleBar1.TitleBarElement.SystemButtons.Children.Insert(1, btnMaximizar);
StackLayoutElement
0
Dimitar
Telerik team
answered on 18 Sep 2018, 06:08 AM
Hello  Leandro,

I would suggest adding both custom controls to the new StackLayoutElement. The key part is to set the StretchHorizontally property of the button to false:
var textbox = new RadAutoCompleteBoxElement();
textbox.Text = "Test";
textbox.MinSize = new Size(400, 0);
 
var btnMaximizar = new RadButtonElement();
btnMaximizar.Text = "FullScreen";
btnMaximizar.StretchHorizontally = false;
 
 
StackLayoutElement stack = new StackLayoutElement();
stack.Orientation = Orientation.Horizontal;
 
stack.Children.Add(textbox);
stack.Children.Add(btnMaximizar);
this.radTitleBar1.TitleBarElement.SystemButtons.Children.Insert(0, stack);

I hope this will be useful. 

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.
0
Leandro
Top achievements
Rank 1
answered on 18 Sep 2018, 09:00 AM
Nice! Is there anyway to set RadShappedForm to fullscreen?
0
Dimitar
Telerik team
answered on 18 Sep 2018, 11:00 AM
Hi Leandro,

Just set the WindowsState like in a regular form:
this.WindowState = FormWindowState.Maximized;

I hope this will be useful. 

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
Leandro
Top achievements
Rank 1
answered on 18 Sep 2018, 11:52 AM
I think u got it wrong, I mean fullscreen(no taskbar), not maximized  
0
Accepted
Dimitar
Telerik team
answered on 18 Sep 2018, 01:15 PM
Hello Leandro,

We do not have such mode out of the box but this is possible and a good example is available here: Windows forms make form cover taskbar sample in C#, VB.NET for Visual Studio 2015

Let me know how this works for you.

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
Leandro
Top achievements
Rank 1
answered on 18 Sep 2018, 02:41 PM
yeah! it works, thanks!
Tags
TitleBar
Asked by
Leandro
Top achievements
Rank 1
Answers by
Leandro
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or