mjiansun 2015-05-10 15:02 采纳率: 50%
浏览 6725
已采纳

C# 用户控件的Load事件不能执行

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Security.Cryptography;
using System.IO;
using OpenPOP.POP3;
using System.Collections;
using OpenPOP.MIMEParser;
using System.Threading;
using mymail.sqlDao;
using System.Data.SqlClient;
using mymail;

namespace mymail
{
public partial class inbox : UserControl
{

    public inbox()
    {
        InitializeComponent();
    }

    private void inbox_Load(object sender, EventArgs e)
    {
        msgs.Clear();

        //listMessages.Nodes.Clear();//邮件列表
        listAttachments.Nodes.Clear();//附件列表
        listView1.Clear();//清除空间中所有项
        //button2.Enabled = false;
        //button3.Enabled = false;
        //ReceiveMails();
    }
  • 写回答

5条回答 默认 最新

  • threenewbee 2015-05-10 15:39
    关注

    在你的inbox.designer.cs中的InitializeComponent的定义中有没有挂钩事件:
    this.Load += new EventHandler(this.inbox_Load);

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?