Hi !
I'm trying to get the code behind the formatting menu for forms like aligning, uniforming the size, spacing (vertically, horizontally).. Because I have my own application with forms and I need to control them like I can do it with Visual Studio.
Can anyone help me please ?
Thank you !
5 Answers, 1 is accepted
0

Hamza
Top achievements
Rank 1
answered on 30 Jan 2018, 02:17 PM
Here's a picture of the menu Format so you can all have an idea what I'm talking about..
0
Hello, Hamza,
Thank you for writing.
In order to achieve the menu from the provided screenshot it is suitable to use RadMenu. Here is a sample code snippet demonstrating how to achieve a similar look:

I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Progress Telerik
Thank you for writing.
In order to achieve the menu from the provided screenshot it is suitable to use RadMenu. Here is a sample code snippet demonstrating how to achieve a similar look:
public
RadForm1()
{
InitializeComponent();
ThemeResolutionService.ApplicationThemeName =
"VisualStudio2012Dark"
;
RadMenuItem formatItem =
new
RadMenuItem();
formatItem.Text =
"Format"
;
this
.radMenu1.Items.Add(formatItem);
RadMenuItem alignmentItem =
new
RadMenuItem();
alignmentItem.Text =
"Alignment"
;
formatItem.Items.Add(alignmentItem);
RadMenuItem leftItem =
new
RadMenuItem();
leftItem.Text =
"Left"
;
leftItem.Image = Properties.Resources.Format_Align_Left;
leftItem.Click += leftItem_Click;
RadMenuItem rightItem =
new
RadMenuItem();
rightItem.Text =
"Right"
;
rightItem.Image = Properties.Resources.Format_Align_Left;
rightItem.Click += rightItem_Click;
RadMenuItem centerItem =
new
RadMenuItem();
centerItem.Text =
"Center"
;
centerItem.Image = Properties.Resources.Format_Align_Left;
centerItem.Click += centerItem_Click;
alignmentItem.Items.Add(leftItem);
alignmentItem.Items.Add(centerItem);
alignmentItem.Items.Add(rightItem);
}
private
void
centerItem_Click(
object
sender, EventArgs e)
{
//TODO
}
private
void
rightItem_Click(
object
sender, EventArgs e)
{
//TODO
}
private
void
leftItem_Click(
object
sender, EventArgs e)
{
//TODO
}
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.
0

Hamza
Top achievements
Rank 1
answered on 05 Feb 2018, 08:35 AM
Hi dess !
Thank you for your reply. I already did this but my problem is "the behavior" of the functions behind. I mean where can I find a function that aligns two components to left or right..
Thanks again !
0
Hello, Hamza,
Thank you for writing back.
The mentioned functionality for aligning the controls at design time comes from the built-in Visual Studio functionality. Telerik UI for WinForms suite doesn't have any effect on it or access to its implementation. Note that each RadControl has a Location property by which you can control where the control will be positioned within its container. Thus, you can adjust the location and achieve the desired custom controls' alignment.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Progress Telerik
Thank you for writing back.
The mentioned functionality for aligning the controls at design time comes from the built-in Visual Studio functionality. Telerik UI for WinForms suite doesn't have any effect on it or access to its implementation. Note that each RadControl has a Location property by which you can control where the control will be positioned within its container. Thus, you can adjust the location and achieve the desired custom controls' alignment.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.
0

Hamza
Top achievements
Rank 1
answered on 06 Feb 2018, 01:02 PM
I finally found a solution to directly acceed to the implemented functions of visual studio by creating a class and make it inherits from DesignSurface class, then create an instance of it and use "InvokeMenuCommand(StandardCommands."MyCommand")"
Thank you!
Thank you!