Расширение для windows forms

Syncfusion WinForms Extensions

The Syncfusion® Essential Studio® WinForms extensions provide a powerful set of tools within Visual Studio, allowing you to create applications using pre-built templates that integrate Syncfusion® WinForms components. These extensions are specifically engineered to enhance productivity and streamline the process of creating WinForms applications in Visual Studio.

These extensions include a ready-to-use WinForms template studio, serving as a convenient starting point for your development work. Whether you’re an experienced developer or just a beginner, the Syncfusion® WinForms Visual Studio extensions offer numerous benefits, making them the ideal choice for anyone seeking to integrate preconfigured native WinForms components into their projects.

Highlights:

  • Superior user interface performance with a responsive design, seamless integration, and UI controls crafted to be lightweight and modular, all available in one convenient package.
  • With our user-centric design, the controls offer an exceptional experience, ensuring that your users easily navigate and interact with your app.
  • WinForms projects are easy to configure with Syncfusion® control references (NuGet packages are automatically downloaded from NuGet.org, no installer required).

Note: Install this extension for Visual Studio 2019 or older versions.

Create a new Syncfusion WinForms app in Visual Studio

The Syncfusion WinForms Template Studio is a Visual Studio extension designed to accelerate the creation of WinForms applications. The resulting project will boasts well-organized, easily understandable code, seamlessly incorporating Syncfusion® WinForms components and their functionalities. After installing the extensions, you can find the Template Studio under Extensions > Syncfusion > Essential Studio® for WinForms. Here, you can initiate a new Syncfusion project. Alternatively, you can access the wizard from the project menu. There, you’ll find the option for a “Syncfusion C# WinForms Application”. Follow the subsequent steps to name your new project and specify a location, then click ‘Create’. This will lead you to a screen where you can select the preferred Syncfusion® WinForms configurations, project types, pages, control features, and app features for your new project.

Syncfusion WinForms new project creation

To learn more about the template studio, refer this documentation.

Syncfusion WinForms Item Template

The Syncfusion WinForms item template simplifies integrating WinForms XAML for Syncfusion® WinForms components into your applications. Its intuitive interface, it efficiently gathers essential information such as Syncfusion® components, assemblies, and version configurations for the selected elements. This significantly expedites the development of standard operations.

Additionally, within this template, you can select the desired WinForms control from the control list. Once selected, the associated features for that control will be presented. You can then choose the specific features you need for your project.

After installing the Syncfusion® WinForms Visual Studio extensions, accessing the template is straightforward Right-click on your project in the solution explorer, navigate to Add Syncfusion Item, and you’ll be directed to a screen from which you select the desired components for your project. This streamlined process ensures a smooth and efficient development experience.

Syncfusion WinForms Extensions item template

To learn more about the item template, refer to this documentation

Syncfusion WinForms Reference Manager

If you already have a WinForms application that needs to be enhanced with Syncfusion® WinForms components, the reference manager will help you do so with just a few clicks. The reference manager Visual Studio add-in adds the Syncfusion® WinForms assemblies and NuGet packages to a WinForms app for the selected components. Once you’ve installed the Syncfusion® WinForms Visual Studio extensions, you’ll find the reference manager by right-clicking on the project in the solution explorer and navigating to Add Syncfusion Reference Manager…. You will then be taken to a screen where you can select the Syncfusion® WinForms versions and components to add to your WinForms project.

Syncfusion WinForms Extensions reference manager

To learn more about the reference manager, refer to this documentation.

Syncfusion Troubleshooter

If you have Syncfusion® assembly or assets configuration issues in your application, the Syncfusion troubleshooter will help you report and fix them with just a few clicks. The Syncfusion troubleshooter Visual Studio add-in reports and fixes assembly configuration, NuGet configuration, and toolbox configuration issues in WinForms applications. Once you’ve installed the Syncfusion® WinForms Visual Studio extensions, you’ll find the troubleshooter by right-clicking on the project in the solution explorer and navigating to Syncfusion Troubleshooter…. You will then be taken to a screen where you can see the configuration issues in your project.

Syncfusion WinForms Extensions troubleshooter

To learn more about the troubleshooter, refer to this documentation.


Learn more about WinForms UI controls

Download free trial

Release history

Pricing

Online demos

Community forums

Suggest a feature

About Syncfusion®


Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion® has more than 29,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies.

Today, we provide 1,800+ components and frameworks for web (Blazor, Flutter, ASP.NET Core, ASP.NET MVC, ASP.NET WebForms, JavaScript, Angular, React, Vue, and jQuery, mobile (.NET MAUI, Flutter, Xamarin, UWP, and JavaScript), and desktop development (WinForms, WPF, WinUI, .NET MAUI, Flutter, Xamarin, and UWP). We provide ready-to-deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software.

sales@syncfusion.com | Toll Free: 1-888-9 DOTNET

Windows Forms Extensions

The Windows Forms Extensions library has been created to provide elegant and
useful features, which are available in Web technologies or XAML (WPF, …)
to the Windows Forms technology.

The list of implemented helpers contains methods such as Animate(), which
have been implemented using higher possibilities of the C# programming
language (like extension methods or anonymous objects). Included methods
are not limited to the Windows Forms technology (such as extending classes
like Form or Control), but can also extend the possibilites of the
.NET-Framework.

If you are willing to contribute to this project (either with new ideas or
existing codes), you are more than welcome.

Current status

The current version number is 0.1.8. This version is still an incomplete alpha build.
A NuGet package is available. The package can be found over the Package Manager or the
NuGet Website.

Version history

0.1.8:

  • Added a new class called AjaxRequest to perform async or sync webrequests similar to jQuery
  • Added a new control called PushButton
  • The WindowX form now has three PushButton instead of normal Button instances
  • Improved the Notify() extension method to return the control and to include infinite lifetime
  • Improved the toast notification drawing
  • Fixed some small bugs regarding the WindowX form
  • Added a small, yet complete JSON parser — just to avoid including external libraries

0.1.7:

  • Added a new extension method Glow() to any Graphics object
  • Added a new Control called TransparentPanel
  • Added a new extension method Notify() to any Form object
  • Improved the DrawShadow() method
  • Fixed a bug when restoring the WindowX form

0.1.6:

  • Added new datatypes PointD and SizeD (shouldn’t be needed to often, but can be helpful)
  • Fixed some namespace inconsistencies (now all GDI+ stuff is located in System.DrawingX)
  • Fixed a minor designer bug for the WindowX form and improved the designer possibilities
  • Improved the Animate() method to support an arbitrary number of nested values (instead of only one nested level)
  • Extended the demo version for the CodeProject article

0.1.5:

  • Added some more Win32 API function calls (mostly DWM)
  • Added a derived Form class for building Metro-like applications
  • Extension method for Bitmap object (ChangeColor())

0.1.0:

  • Extension methods for the Graphics object (DrawRoundRectangle(), DrawShadow(), DrawReflection(), DrawImageSmooth())
  • Extension method for the GraphicPath object (AddRoundRectangle())
  • Extension methods for the Image object (FindDominantColor(), Resize(), GetGrayScaleVersion())
  • Extension methods for the Uri object (Request(), JsonRequest())
  • Extension methods for the Control object (Animate(), Shadow())

Benefits of using WinFormX

  • Included animations
  • More dynamic applications
  • Forms with different designs and extended possibilities
  • More options included in GDI+
  • Selectors and various helpers
  • Useful (but mostly unknown) API function calls have been included

Participating in the project

If you know some feature that Windows Forms is currently missing, and you
are willing to implement the feature (or have already implemented it), then
your contribution is more than welcome!

Currently implemented methods

Here will be some text about already implemented methods and links to obtain further information.
Some information can be found on the official webpage.

Some legal stuff

Copyright (c) 2012, Florian Rappl.

This project is licensed under the Code Project Open License
(CPOL) 1.02.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the license
is respected in every way.

THE SOFTWARE IS PROVIDED «AS IS» AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

  • README

  • Frameworks

  • Dependencies

  • Used By

  • Versions

Extension library for the System.Windows.Forms objects and types.

Product

Compatible and additional computed target framework versions.

.NET

net5.0 is compatible. 

net5.0-windows was computed. 

net6.0 is compatible. 

net6.0-android was computed. 

net6.0-ios was computed. 

net6.0-maccatalyst was computed. 

net6.0-macos was computed. 

net6.0-tvos was computed. 

net6.0-windows was computed. 

net7.0 was computed. 

net7.0-android was computed. 

net7.0-ios was computed. 

net7.0-maccatalyst was computed. 

net7.0-macos was computed. 

net7.0-tvos was computed. 

net7.0-windows was computed. 

net8.0 was computed. 

net8.0-android was computed. 

net8.0-browser was computed. 

net8.0-ios was computed. 

net8.0-maccatalyst was computed. 

net8.0-macos was computed. 

net8.0-tvos was computed. 

net8.0-windows was computed. 

net9.0 was computed. 

net9.0-android was computed. 

net9.0-browser was computed. 

net9.0-ios was computed. 

net9.0-maccatalyst was computed. 

net9.0-macos was computed. 

net9.0-tvos was computed. 

net9.0-windows was computed. 

.NET Core

netcoreapp2.0 is compatible. 

netcoreapp2.1 is compatible. 

netcoreapp2.2 is compatible. 

netcoreapp3.0 is compatible. 

netcoreapp3.1 is compatible. 

.NET Standard

netstandard2.0 is compatible. 

netstandard2.1 is compatible. 

.NET Framework

net46 is compatible. 

net461 is compatible. 

net462 is compatible. 

net463 was computed. 

net47 is compatible. 

net471 is compatible. 

net472 is compatible. 

net48 is compatible. 

net481 was computed. 

MonoAndroid

monoandroid was computed. 

MonoMac

monomac was computed. 

MonoTouch

monotouch was computed. 

Tizen

tizen40 was computed. 

tizen60 was computed. 

Xamarin.iOS

xamarinios was computed. 

Xamarin.Mac

xamarinmac was computed. 

Xamarin.TVOS

xamarintvos was computed. 

Xamarin.WatchOS

xamarinwatchos was computed. 

  • .NETCoreApp 2.0

    • No dependencies.
  • .NETCoreApp 2.1

    • No dependencies.
  • .NETCoreApp 2.2

    • No dependencies.
  • .NETCoreApp 3.0

    • No dependencies.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETFramework 4.7

    • No dependencies.
  • .NETFramework 4.7.1

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Lib.Extensions.System.Windows.Forms:

Package Downloads

Lib.Extensions.WinForms

Extension container library for the winforms applications.

9.8K

GitHub repositories

This package is not used by any popular GitHub repositories.

Syncfusion Docking Windows, TreeView and Ribbon controls for Windows Forms

This package provides the functionality to utilize the features of Syncfusion® WinForms Autocomplete, Carousel, Menu, Multicolumn ComboBox, Color Picker, Docking Manager, Hub Tile, Navigation Drawer, Navigation View, Radial Menu, Radial Slider, Range Slider, Rating, Ribbon, Spell Checker, Split Cont…

Score: 4.8


| 2/2/2021 | v29.1.40

Запись от anomal6 размещена 03.09.2019 в 22:13


Всем добра читающие гости форумчане.
Задался я тут вопросом таким можно ли легко и просто сменить дизайн формы. Есть у меня программа, написанная рабочая, всё хорошо.
Но дизайн на WinForms оставляет желать лучшего.

Как то «не айс»!

Попробовав через NuGet MetroFrameWork переплевался полностью. Так как нормальный дизайн отсутствует, и если Вы захотите скрыть кнопки навигации приготовьтесь к багам.
Потом попробовал MaterialSkin всё через тот же NuGet. Тут я просрался.
Ну во-первых там есть даже PersianMaterialSkin. Парень скомуниздил дизайн, добавил ООЧЕНЬ КОРЯВЫЙ ListView, переделал шрифт под не читаемый вовсе, и выложил под своим копирайтом. Ну типа плюс от этого GitHub, но глянув GitHub’a внутрь, и решив поменять dll под себя (ну шрифты там всякие, размер полей) блеванул пару раз, и понял что лучше с ноля самому писать. Дальше я пошёл Гуглить…

Гуглёжка привела меня к тому что танцы с бубном неизбежны, и придётся в кровь пальцы стереть чтобы получить нормальную форму. Не хочешь крови ? go WPF.

По-WPF’ил я немного методом научного тыка и понял, что учить надо, и так просто на WPF не перейти.
И красивенькая форма пусть снится ночами.

Но полазив по форуму я тут вычитал что можно и круглые углы сделать но вот только

C#
1
this.FormBorderStyle.None;

Но изучив вопрос нашёл код который таскает форму за любой пиксель.

код который таскает WinForm за любой пиксель

Сначала добавим библиотеку

C#
1
using System.Runtime.InteropServices;
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[DllImport("Gdi32.dll")]
        public static extern IntPtr CreateRoundRectRgn(int nLeftRect,
                                                          int nTopRect,
                                                          int nRightRect,
                                                          int nBottomRect,
                                                          int nWidthEllipse,
                                                          int nHeightEllipse);
 
        [DllImport("user32.dll")]
        public static extern int SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool bRedraw);
        private bool Drag;
        private int MouseX;
        private int MouseY;
 
        private const int WM_NCHITTEST = 0x84;
        private const int HTCLIENT = 0x1;
        private const int HTCAPTION = 0x2;
 
        private bool m_aeroEnabled;
 
        private const int CS_DROPSHADOW = 0x00020000;
        private const int WM_NCPAINT = 0x0085;
        private const int WM_ACTIVATEAPP = 0x001C;
 
        [System.Runtime.InteropServices.DllImport("dwmapi.dll")]
        public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarInset);
        [System.Runtime.InteropServices.DllImport("dwmapi.dll")]
        public static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int attrValue, int attrSize);
        [System.Runtime.InteropServices.DllImport("dwmapi.dll")]
 
        public static extern int DwmIsCompositionEnabled(ref int pfEnabled);
 
 
 
        public struct MARGINS
        {
            public int leftWidth;
            public int rightWidth;
            public int topHeight;
            public int bottomHeight;
        }
        protected override CreateParams CreateParams
        {
            get
            {
                m_aeroEnabled = CheckAeroEnabled();
                CreateParams cp = base.CreateParams;
                if (!m_aeroEnabled)
                    cp.ClassStyle |= CS_DROPSHADOW; return cp;
            }
        }
        private bool CheckAeroEnabled()
        {
            if (Environment.OSVersion.Version.Major >= 6)
            {
                int enabled = 0; DwmIsCompositionEnabled(ref enabled);
                return (enabled == 1) ? true : false;
            }
            return false;
        }
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
                case WM_NCPAINT:
                    if (m_aeroEnabled)
                    {
                        var v = 2;
                        DwmSetWindowAttribute(this.Handle, 2, ref v, 4);
                        MARGINS margins = new MARGINS()
                        {
                            bottomHeight = 1,
                            leftWidth = 0,
                            rightWidth = 0,
                            topHeight = 0
                        }; DwmExtendFrameIntoClientArea(this.Handle, ref margins);
                    }
                    break;
                default: break;
            }
            base.WndProc(ref m);
            if (m.Msg == WM_NCHITTEST && (int)m.Result == HTCLIENT) m.Result = (IntPtr)HTCAPTION;
        }
        private void PanelMove_MouseDown(object sender, MouseEventArgs e)
        {
            Drag = true;
            MouseX = Cursor.Position.X - this.Left;
            MouseY = Cursor.Position.Y - this.Top;
           
        }
        private void PanelMove_MouseMove(object sender, MouseEventArgs e)
        {
            if (Drag)
            {
                this.Top = Cursor.Position.Y - MouseY;
                this.Left = Cursor.Position.X - MouseX;
               
            }
        }
        private void PanelMove_MouseUp(object sender, MouseEventArgs e) { Drag = false; }

Попробовав на пустом проекте мне эта идея приглянулась.
Единственное что у формы теперь нет кнопок навигации, и никакой окантовки.

Ну да пофиг подумал я, и начал панелями создавать цветные формы.
Ващее огонь подумал я сделав одну форму. Нарадоваться не мог. Сделал вторую, думаю ништяк, но чёт я заколебался.
Впереди ещё 5 форм.
Каждой пририсовывать панель, это вроде не долго, но пока всё выставишь проходит 30 минут.

Ну и решил : «Создам-ка я своё расширение»
Не так давно почитал за расширения, и принялся писать.

Как в итоге получилось совсем немного.
Создал в отдельном статическом классе.

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
public static class FormComponent
    {
        //Элементы тоже статичные чтобы к ним обращаться
        public static Label label = new Label();
        public static Panel panel = new Panel();
        public static Panel panel2 = new Panel();
        public static Button close = new Button();
 
        public static void AddFormPanel(this Form form, string FormNameLabel)
        {
 
            Color HotTrack = ColorTranslator.FromHtml("#0066CC");
            Color White = ColorTranslator.FromHtml("#FFFFFF");
 
            form.FormBorderStyle = FormBorderStyle.None;
            form.BackColor = Color.FromKnownColor(KnownColor.ControlLightLight);
 
            panel2.Dock = DockStyle.Top;
            panel2.Height = 45;
            panel2.BackColor = Color.FromKnownColor(KnownColor.MenuHighlight);
 
            label.Text = FormNameLabel;
            label.ForeColor = Color.FromKnownColor(KnownColor.ControlLightLight);
            label.Font = new Font("Cambria", 14.25f, FontStyle.Italic);
            label.AutoSize = true;
            label.Location = new Point(3, 3);
 
            panel2.Controls.Add(label);
            form.Controls.Add(panel2);
 
            panel.Dock = DockStyle.Top;
            panel.Height = 25;
            panel.BackColor = HotTrack;
 
            close.Size = new Size(25, 25);
            close.Name = "bClose";
            close.Text = "X";
            close.FlatStyle = FlatStyle.Flat;
            close.FlatAppearance.BorderSize = 0;
            close.Location = new Point(form.Size.Width - close.Width - 3, -2);
            close.ForeColor = Color.FromKnownColor(KnownColor.ControlLightLight);
            close.Font = new Font("Comic Sans", 9.75f, FontStyle.Bold);
 
            panel.Controls.Add(close);
            form.Controls.Add(panel);
 
 
        }
 
 
    }

Код самый простой, и даёт на деле получить красивую картинку.
На основной форме пишем

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 public Form()
        {
            InitializeComponent();
            this.AddFormPanel("Новое задание");
            FormComponent.panel.MouseDown += new MouseEventHandler(PanelMove_MouseDown);
            FormComponent.panel.MouseMove += new MouseEventHandler(PanelMove_MouseMove);
            FormComponent.panel.MouseUp += new MouseEventHandler(PanelMove_MouseUp);
            FormComponent.panel2.MouseDown += new MouseEventHandler(PanelMove_MouseDown);
            FormComponent.panel2.MouseMove += new MouseEventHandler(PanelMove_MouseMove);
            FormComponent.panel2.MouseUp += new MouseEventHandler(PanelMove_MouseUp);
            FormComponent.close.Click += Close_Click;
        }
 
        private void Close_Click(object sender, EventArgs e)
        {
            this.Close();
        }
C#
1
FormComponent.panel.MouseDown += new MouseEventHandler(PanelMove_MouseDown);

Даст возможность двигать не только за пиксель формы, но и за панель которую мы добавили.

А на выходе всего этого мы получаем

Скажете что я наркоман? Да! но зато я вижу в этом прекрасное.

upd1. Для того чтобы края формы были закруглены в событие загрузки формы нужно добавить

C#
1
2
IntPtr hRgn = CreateRoundRectRgn(0, 0, ШиринаФормы, ВысотаФормы, 10, 10); //10 это какой скос будет
            SetWindowRgn(this.Handle, hRgn, true);

upd2.Для того чтобы при перетаскивании была форма как на видео нужно добавить

C#
1
this.Opacity = *

у меня стоит так

C#
1
2
3
4
5
6
7
8
9
10
 private void PanelMove_MouseMove(object sender, MouseEventArgs e)
        {
            if (Drag)
            {
                this.Top = Cursor.Position.Y - MouseY;
                this.Left = Cursor.Position.X - MouseX;
                this.Opacity = 0.5;
            }
        }
        private void PanelMove_MouseUp(object sender, MouseEventArgs e) { Drag = false; this.Opacity = 1; }

P.S. Возможно я для кого то наркоман, а возможно кому то это пригодится. Вот лично мне это нужно было.
Менять, добавлять изменять можно как душе угодно.
Тестовый проект приложил

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • The windows installer service could not be accessed как исправить
  • Полноценный windows на смартфоне
  • Boot disk utility for windows
  • Как сделать динамики на ноутбуке громче windows 10
  • Чем просматривать jpg в windows 10