欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

DOTNETBAR制作圓角窗體和圓角控件代碼實(shí)例

 更新時(shí)間:2013年11月27日 10:26:46   作者:  
這篇文章主要介紹了DOTNETBAR制作圓角窗體和圓角控件的方法,大家參考使用吧

1、如果制作圓角窗體,窗體先繼承DOTNETBAR的:public partial class Form2 : DevComponents.DotNetBar.Office2007Form

然后窗體里加上一個(gè)DONTERBAR的panel,然后設(shè)置panel為fill占滿整個(gè)窗體

然后設(shè)置panel的CornerType為Rounded,然后窗體就變?yōu)閳A角的了: panelEx1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;

2、如果是圓角控件就照葫蘆畫瓢,把panel放在控件上面,然后設(shè)置為fill,再設(shè)置panel的CornerType為Rounded就變?yōu)閳A角控件了

DOTNETBAR的button控件默認(rèn)就可以設(shè)置為圓角按鈕的

今天弄個(gè)了一天最后弄出了圓角窗體,可是不是用DOTNETBAR,原來DOTNETBAR實(shí)現(xiàn)不了,以下是本人實(shí)現(xiàn)圓角窗體的代碼

 

復(fù)制代碼 代碼如下:

 /// <summary>
        /// 重繪窗體為圓角
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DispenserForm_Paint(object sender, PaintEventArgs e)
        {
            Form form = ((Form)sender);
            List<Point> list = new List<Point>();
            int width = form.Width;
            int height = form.Height;

            //左上
            list.Add(new Point(0, 5));
            list.Add(new Point(1, 5));
            list.Add(new Point(1, 3));
            list.Add(new Point(2, 3));
            list.Add(new Point(2, 2));
            list.Add(new Point(3, 2));
            list.Add(new Point(3, 1));
            list.Add(new Point(5, 1));
            list.Add(new Point(5, 0));
            //右上
            list.Add(new Point(width - 5, 0));
            list.Add(new Point(width - 5, 1));
            list.Add(new Point(width - 3, 1));
            list.Add(new Point(width - 3, 2));
            list.Add(new Point(width - 2, 2));
            list.Add(new Point(width - 2, 3));
            list.Add(new Point(width - 1, 3));
            list.Add(new Point(width - 1, 5));
            list.Add(new Point(width - 0, 5));
            //右下
            list.Add(new Point(width - 0, height - 5));
            list.Add(new Point(width - 1, height - 5));
            list.Add(new Point(width - 1, height - 3));
            list.Add(new Point(width - 2, height - 3));
            list.Add(new Point(width - 2, height - 2));
            list.Add(new Point(width - 3, height - 2));
            list.Add(new Point(width - 3, height - 1));
            list.Add(new Point(width - 5, height - 1));
            list.Add(new Point(width - 5, height - 0));
            //左下
            list.Add(new Point(5, height - 0));
            list.Add(new Point(5, height - 1));
            list.Add(new Point(3, height - 1));
            list.Add(new Point(3, height - 2));
            list.Add(new Point(2, height - 2));
            list.Add(new Point(2, height - 3));
            list.Add(new Point(1, height - 3));
            list.Add(new Point(1, height - 5));
            list.Add(new Point(0, height - 5));

            Point[] points = list.ToArray();

            GraphicsPath shape = new GraphicsPath();
            shape.AddPolygon(points);

            //將窗體的顯示區(qū)域設(shè)為GraphicsPath的實(shí)例
            form.Region = new System.Drawing.Region(shape);
        }
 

相關(guān)文章

  • C#中的事務(wù)用法實(shí)例分析

    C#中的事務(wù)用法實(shí)例分析

    這篇文章主要介紹了C#中的事務(wù)用法,以一個(gè)簡單實(shí)例形式分析了C#創(chuàng)建及使用事物的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
    2015-09-09
  • C#使用正則表達(dá)式抓取網(wǎng)站信息示例

    C#使用正則表達(dá)式抓取網(wǎng)站信息示例

    這篇文章主要介紹了C#使用正則表達(dá)式抓取網(wǎng)站信息,結(jié)合實(shí)例形式分析了C#針對網(wǎng)頁信息的正則抓取操作相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
    2017-01-01
  • C#程序啟動(dòng)項(xiàng)的設(shè)置方法

    C#程序啟動(dòng)項(xiàng)的設(shè)置方法

    這篇文章主要為大家詳細(xì)介紹了C#程序啟動(dòng)項(xiàng)的設(shè)置方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-11-11
  • C#使用GDI+實(shí)現(xiàn)生成驗(yàn)證碼

    C#使用GDI+實(shí)現(xiàn)生成驗(yàn)證碼

    這篇文章介紹了C#使用GDI+實(shí)現(xiàn)生成驗(yàn)證碼的方法,文中通過示例代碼介紹的非常詳細(xì)。對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-05-05
  • C# 鼠標(biāo)穿透窗體功能的實(shí)現(xiàn)方法

    C# 鼠標(biāo)穿透窗體功能的實(shí)現(xiàn)方法

    通過以下代碼,在窗體啟動(dòng)后調(diào)用方法SetPenetrate() 即可實(shí)現(xiàn)窗體的穿透功能,有需要的朋友可以參考一下
    2013-10-10
  • c# 重載WndProc,實(shí)現(xiàn)重寫“最小化”的實(shí)現(xiàn)方法

    c# 重載WndProc,實(shí)現(xiàn)重寫“最小化”的實(shí)現(xiàn)方法

    在做“亦歌桌面版”的時(shí)候,發(fā)現(xiàn)當(dāng)打開歌詞狀態(tài)下,用最小化隱藏窗體到托盤的話(如下code #1),在調(diào)出發(fā)現(xiàn)歌詞縮小了(雖然顯現(xiàn)的窗體大小跟剛才一樣),從這點(diǎn)看調(diào)用該方法其實(shí)窗體大小是改變了的(這個(gè)過程只是不可視而已)。
    2009-02-02
  • WPF實(shí)現(xiàn)篩選下拉多選控件的示例代碼

    WPF實(shí)現(xiàn)篩選下拉多選控件的示例代碼

    這篇文章主要為大家詳細(xì)介紹了WPF如何實(shí)現(xiàn)篩選下拉多選控件,文中的示例代碼講解詳細(xì),對我們學(xué)習(xí)或工作有一定幫助,感興趣的小伙伴可以了解一下
    2023-06-06
  • C#對集合進(jìn)行排序

    C#對集合進(jìn)行排序

    這篇文章介紹了C#對集合進(jìn)行排序的方法,文中通過示例代碼介紹的非常詳細(xì)。對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-03-03
  • c#圖像截取實(shí)例

    c#圖像截取實(shí)例

    這篇文章主要介紹了c#圖像截取實(shí)例,是Windows桌面應(yīng)用程序設(shè)計(jì)中一個(gè)非常實(shí)用的技巧,本文實(shí)例中備有較為詳細(xì)的注釋便于理解,需要的朋友可以參考下
    2014-10-10
  • 通過C#調(diào)用cmd來修改服務(wù)啟動(dòng)類型

    通過C#調(diào)用cmd來修改服務(wù)啟動(dòng)類型

    可以使用System.ServiceProcess.ServiceController這個(gè)類允許連接到正在運(yùn)行或者已停止的服務(wù)、對其進(jìn)行操作或獲取有關(guān)它的信息但是這個(gè)類并沒有提供修改服務(wù)啟動(dòng)類型的方法,可以通過C#調(diào)用cmd來修改
    2012-12-12

最新評論