如何调试ToolStrip错误“'child'不是这个父级的子控件”?

时间:2016-01-01 12:25:51

标签: c# .net custom-controls windows-forms-designer

我已经创建了一个自定义ToolStrip控件和ToolStripControl控件,以便我可以完全自定义它们的所有部分主要是悬停事件,但是我在Designer中遇到了一个问题,它会抛出此错误:

  

'child'不是此父级的子控件

这是我添加控件时的代码

CheckType

我上面引用的private bool CheckType(Type check, Type checkType) { if (check == checkType) { return true; } else { if (check.BaseType != null) { return CheckType(check.BaseType, checkType); } else { return false; } } } 函数

ToolStripPro

以下是[Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] public partial class ToolStripPro : UserControl 控件

的类声明
            date_default_timezone_set('Asia/Kolkata');

             require 'php-mailer/class.phpmailer.php';
             print_r($_POST);
            $name = $_POST['name'];
            $email = $_POST['email'];
            $subject = $_POST['subject'];
            $message = $_POST['message'];
            $personel_email = 'mohdahsan.ascomputer@gmail.com';

            //Create a new PHPMailer instance
            $mail = new PHPMailer;
            //Tell PHPMailer to use SMTP
            //$mail->isSMTP();
            //Enable SMTP debugging
            // 0 = off (for production use)
            // 1 = client messages
            // 2 = client and server messages
            $mail->SMTPDebug = 0;
            //Ask for HTML-friendly debug output
            $mail->Debugoutput = 'html';
            //Set the hostname of the mail server
            $mail->Host = "mail.abc.com";
            //$mail->Host = "localhost";
            //Set the SMTP port number - likely to be 25, 465 or 587
            $mail->Port = 26;
            //Whether to use SMTP authentication
            $mail->SMTPAuth = true;
            //Username to use for SMTP authentication
            $mail->Username = "sales@abc.com";
            //Password to use for SMTP authentication
            $mail->Password = "****";
            //$mail->SMTPSecure = "tls";
            //Set who the message is to be sent from
            $mail->setFrom($email, 'Gaurav Hart');
            //Set an alternative reply-to address
            $mail->addReplyTo($personel_email, 'Info');
            //Set who the message is to be sent to
            //$mail->addAddress('admin@shennaimatrimonials.com', 'Admin');
            $mail->addAddress($personel_email, $personel_email);
            //Set the subject line
            $mail->Subject = $subject;
            //Read an HTML message body from an external file, convert referenced images to embedded,
            //convert HTML into a basic plain-text alternative body
            //$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
            //$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
            $message=$message;
            $mail->Body = preg_replace('/\[\]/','',$message);
            //Replace the plain text body with one created manually
            $mail->AltBody = 'Enquiry';
            //Attach an image file
            //$mail->addAttachment('../ajax.php');
            //$mail->addAttachment("../daily_report/exported_files/$date/Daily Report $date.xlsx");

            //send the message, check for errors
            if (!$mail->send()) {
                echo "Mailer Error: " . $mail->ErrorInfo;
            }
            else
            {
                echo "success";
            }

我认为其他一切只是VisualStudio和设计师的内容。我可能错了,但这应该让我知道我的情况。

0 个答案:

没有答案
相关问题