开发者

Problem in Form Show

开发者 https://www.devze.com 2023-02-06 19:29 出处:网络
i wrote this code but when i run it the debugger prompt me \"DragDrop registration did not succeed.\" in FormAdver.show(); line , how can i fix it ?

i wrote this code but when i run it the debugger prompt me "DragDrop registration did not succeed." in FormAdver.show(); line , how can i fix it ?

    public void ResiveFunc(string FuncResive)
    {


        string FuncName = "";
        string FuncValue = "";
        for (int i = 0; i <= 2; i++)
        {
            FuncName += FuncResive[i];
        }
        开发者_StackOverflowfor (int j = 4; j <= FuncResive.Length - 1; j++)
        {
            FuncValue += FuncResive[j];
        }
        MessageBox.Show(FuncName);
        MessageBox.Show(FuncValue);
        if (FuncName == "TAB")
        {
            Form1 mainForm = new Form1();
            frmAddver formAddver = new frmAddver();
            formAddver.Show();
            mainForm.AdverFilter(FuncValue);

        }
    }


You have two options

  1. Make sure AllowDrop is false on the controls in FormAdver

  2. Make sure the the Apartment State is set to STA. Either by Thread.CurrentThread.ApartmentState = ApartmentState.STA or using the [STAThread] attribute.

0

精彩评论

暂无评论...
验证码 换一张
取 消