簡體   English   中英

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

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

我正在嘗試圓角我的 Winform。 雖然我安裝了 gdi32.dll,但我收到類似 System.EntryPointNotFoundException: ''Gdi32.dll' DLL'sinde 'CreateRoundRecRgn' 的錯誤。 有沒有辦法在沒有 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