简体   繁体   English

System.EntryPointNotFoundException: ''Gdi32.dll' DLL'sinde 'CreateRoundRecRgn' 未找到'

[英]System.EntryPointNotFoundException: ''Gdi32.dll' DLL'sinde 'CreateRoundRecRgn' not found'

I am trying to round corners of my Winform.我正在尝试圆角我的 Winform。 Although i installed gdi32.dll i am getting an error like System.EntryPointNotFoundException: ''Gdi32.dll' DLL'sinde 'CreateRoundRecRgn' not found.虽然我安装了 gdi32.dll,但我收到类似 System.EntryPointNotFoundException: ''Gdi32.dll' DLL'sinde 'CreateRoundRecRgn' 的错误。 Is there any way to round corner problem without dlls or how can i solve this problem ?有没有办法在没有 dll 的情况下解决圆角问题,或者我该如何解决这个问题?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.IO;



namespace UI
{
    public partial class UI : Form


    {
        [System.Runtime.InteropServices.DllImport("Gdi32.dll", EntryPoint = "CreateRoundRecRgn")]
        private static extern IntPtr CreateRoundRectRgn
            (
            int nLeftRect,          //x-coordiane of upper-left corner
            int nTopRect,           //y-coordiane of upper-left corner
            int nRightRect,         //x-coordiane of upper-left corner
            int nBottomRect,        //x-coordiane of lower-right corner
            int nWidthEllipse,      //x-width of ellipse
            int nHeightEllipse     //x-height of ellipse


            );
        [System.Runtime.InteropServices.DllImport("gdi32.dll", EntryPoint = "DeleObject")]
        private static extern bool DeleteObject(System.IntPtr hObject);

        int TogMove;
        int MValX;
        int MValY;

        public UI()
        {
            InitializeComponent();
            System.IntPtr ptr = CreateRoundRectRgn(0, 0, this.Width, this.Height, 50, 50);
            this.Region = System.Drawing.Region.FromHrgn(ptr);
            DeleteObject(ptr);

        }

您将命名问题“CreateRoundRecRgn”更改为此“CreateRoundRectRgn”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM