アプリケーションは XP で問題なく動作しますが、Win7 に変更すると問題が発生しました。すべてのアプリ コードを確認しましたが、何も見つかりません。わかりました、単一の ListView を新しいウィンドウに配置して実行すると、同じ問題も発生します。私の英語は苦手です。疲れています。助けてください。どうも。
public frmChooseBoxes(int flag, string complex)
{
otbList = Ocean_Turnover_BoxManager.GetOcean_Turnover_BoxesBySql("select * from Ocean_Turnover_Box where Status in (2,3) order by boxnum");
//初始化选择框
if (complex != "")
{
myNums = complex;
string[] numbers = complex.Split(',');
nList = new List<string>();
foreach (string number in numbers)
{
nList.Add(number);
}
}
else
{
nList = null;
}
InitializeComponent();
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmChooseBoxes));
this.btnExit = new System.Windows.Forms.Button();
this.btnRemoveAll = new System.Windows.Forms.Button();
this.btnRemoveSingle = new System.Windows.Forms.Button();
this.btnAddAll = new System.Windows.Forms.Button();
this.btnAddSingle = new System.Windows.Forms.Button();
this.btnConfirm = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.lvSelectBoxes = new System.Windows.Forms.ListView();
this.lvBox = new System.Windows.Forms.ListView();
this.label3 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtBoxNoChk = new System.Windows.Forms.TextBox();
this.lblBoxNoS = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(375, 302);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(75, 23);
this.btnExit.TabIndex = 15;
this.btnExit.Text = "退出";
this.btnExit.UseVisualStyleBackColor = true;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// btnRemoveAll
//
this.btnRemoveAll.Location = new System.Drawing.Point(216, 212);
this.btnRemoveAll.Name = "btnRemoveAll";
this.btnRemoveAll.Size = new System.Drawing.Size(30, 23);
this.btnRemoveAll.TabIndex = 14;
this.btnRemoveAll.Text = "<<";
this.btnRemoveAll.UseVisualStyleBackColor = true;
this.btnRemoveAll.Click += new System.EventHandler(this.btnRemoveAll_Click);
//
// btnRemoveSingle
//
this.btnRemoveSingle.Location = new System.Drawing.Point(216, 183);
this.btnRemoveSingle.Name = "btnRemoveSingle";
this.btnRemoveSingle.Size = new System.Drawing.Size(30, 23);
this.btnRemoveSingle.TabIndex = 13;
this.btnRemoveSingle.Text = "<";
this.btnRemoveSingle.UseVisualStyleBackColor = true;
this.btnRemoveSingle.Click += new System.EventHandler(this.btnRemoveSingle_Click);
//
// btnAddAll
//
this.btnAddAll.Location = new System.Drawing.Point(216, 96);
this.btnAddAll.Name = "btnAddAll";
this.btnAddAll.Size = new System.Drawing.Size(30, 23);
this.btnAddAll.TabIndex = 12;
this.btnAddAll.Text = ">>";
this.btnAddAll.UseVisualStyleBackColor = true;
this.btnAddAll.Click += new System.EventHandler(this.btnAddAll_Click);
//
// btnAddSingle
//
this.btnAddSingle.Location = new System.Drawing.Point(216, 67);
this.btnAddSingle.Name = "btnAddSingle";
this.btnAddSingle.Size = new System.Drawing.Size(30, 23);
this.btnAddSingle.TabIndex = 11;
this.btnAddSingle.Text = ">";
this.btnAddSingle.UseVisualStyleBackColor = true;
this.btnAddSingle.Click += new System.EventHandler(this.btnAddSingle_Click);
//
// btnConfirm
//
this.btnConfirm.Location = new System.Drawing.Point(269, 302);
this.btnConfirm.Name = "btnConfirm";
this.btnConfirm.Size = new System.Drawing.Size(75, 23);
this.btnConfirm.TabIndex = 8;
this.btnConfirm.Text = "确定";
this.btnConfirm.UseVisualStyleBackColor = true;
this.btnConfirm.Click += new System.EventHandler(this.btnConfirm_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(15, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(92, 16);
this.label1.TabIndex = 16;
this.label1.Text = "周转箱列表:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(267, 9);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(92, 16);
this.label2.TabIndex = 17;
this.label2.Text = "已选择周转箱:";
//
// lvSelectBoxes
//
this.lvSelectBoxes.CheckBoxes = true;
this.lvSelectBoxes.Location = new System.Drawing.Point(269, 44);
this.lvSelectBoxes.Name = "lvSelectBoxes";
this.lvSelectBoxes.Size = new System.Drawing.Size(180, 228);
this.lvSelectBoxes.TabIndex = 18;
this.lvSelectBoxes.UseCompatibleStateImageBehavior = false;
this.lvSelectBoxes.View = System.Windows.Forms.View.List;
//
// lvBox
//
this.lvBox.Location = new System.Drawing.Point(12, 28);
this.lvBox.Name = "lvBox";
this.lvBox.Size = new System.Drawing.Size(180, 244);
this.lvBox.TabIndex = 19;
this.lvBox.UseCompatibleStateImageBehavior = false;
this.lvBox.View = System.Windows.Forms.View.List;
//
// label3
//
this.label3.AutoSize = true;
this.label3.ForeColor = System.Drawing.Color.Red;
this.label3.Location = new System.Drawing.Point(267, 25);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(221, 12);
this.label3.TabIndex = 20;
this.label3.Text = "注:选中复选框表示此箱已满,不可再用";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtBoxNoChk);
this.groupBox1.Controls.Add(this.lblBoxNoS);
this.groupBox1.Location = new System.Drawing.Point(12, 279);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(180, 44);
this.groupBox1.TabIndex = 21;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "筛选箱号:";
//
// txtBoxNoChk
//
this.txtBoxNoChk.Location = new System.Drawing.Point(78, 16);
this.txtBoxNoChk.MaxLength = 5;
this.txtBoxNoChk.Name = "txtBoxNoChk";
this.txtBoxNoChk.Size = new System.Drawing.Size(95, 21);
this.txtBoxNoChk.TabIndex = 1;
this.txtBoxNoChk.TextChanged += new System.EventHandler(this.txtBoxNoChk_TextChanged);
//
// lblBoxNoS
//
this.lblBoxNoS.AutoSize = true;
this.lblBoxNoS.Location = new System.Drawing.Point(7, 23);
this.lblBoxNoS.Name = "lblBoxNoS";
this.lblBoxNoS.Size = new System.Drawing.Size(65, 12);
this.lblBoxNoS.TabIndex = 0;
this.lblBoxNoS.Text = "匹配箱号:";
//
// frmChooseBoxes
//
this.ClientSize = new System.Drawing.Size(492, 346);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.label3);
this.Controls.Add(this.lvBox);
this.Controls.Add(this.lvSelectBoxes);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnRemoveAll);
this.Controls.Add(this.btnRemoveSingle);
this.Controls.Add(this.btnAddAll);
this.Controls.Add(this.btnAddSingle);
this.Controls.Add(this.btnConfirm);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "frmChooseBoxes";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "选择箱号";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmChooseBoxes_FormClosing);
this.Load += new System.EventHandler(this.frmChooseBoxes_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}