init lserp cs 5.0
This commit is contained in:
@@ -0,0 +1,157 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using DevExpress.XtraGrid;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Lskj.MyControl {
|
||||
public partial class MyGridControl : GridControl {
|
||||
|
||||
/// <summary>
|
||||
/// 组件父容器
|
||||
/// </summary>
|
||||
private IContainer myContainer;
|
||||
|
||||
/// <summary>
|
||||
/// 搜索框数据列表
|
||||
/// </summary>
|
||||
public GridControl dgv;
|
||||
|
||||
/// <summary>
|
||||
/// 数据面板
|
||||
/// </summary>
|
||||
private Panel dgvPanel;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是显示联想框的状态
|
||||
/// </summary>
|
||||
private bool isImageShow = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否在业务调用Accept事件的时候执行成功
|
||||
/// </summary>
|
||||
private bool isAcceptSuccess = false;
|
||||
public bool IsAcceptSuccess {
|
||||
get { return isAcceptSuccess; }
|
||||
set { isAcceptSuccess = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否允许Accept动作
|
||||
/// </summary>
|
||||
private bool allowAccept = true;
|
||||
public bool AllowAccept {
|
||||
get { return allowAccept; }
|
||||
set { allowAccept = value; }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 选择确认事件接口
|
||||
/// </summary>
|
||||
private EventHandler accept;
|
||||
public EventHandler Accept {
|
||||
get { return accept; }
|
||||
set { accept = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选择确认事件接口
|
||||
/// </summary>
|
||||
public event EventHandler InitAction = null;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<String> NowNameList = new List<string>();
|
||||
|
||||
|
||||
Button btn, btn2;
|
||||
Label lab;
|
||||
public void SetBtn(Button btn) {
|
||||
this.btn = btn;
|
||||
this.dgvPanel.Controls.Add(this.btn);
|
||||
}
|
||||
|
||||
public void SetBtn2(Button btn) {
|
||||
this.btn2 = btn;
|
||||
this.dgvPanel.Controls.Add(this.btn2);
|
||||
}
|
||||
|
||||
public void SetBtnVisible(bool visible) {
|
||||
this.lab.Visible = visible;
|
||||
this.btn.Visible = visible;
|
||||
this.btn2.Visible = visible;
|
||||
if (visible == true) {
|
||||
this.btn.BringToFront();
|
||||
this.btn2.BringToFront();
|
||||
}
|
||||
}
|
||||
|
||||
private string labText = "";
|
||||
public string LabText {
|
||||
get { return labText; }
|
||||
set {
|
||||
labText = value;
|
||||
if (this.lab != null) {
|
||||
this.lab.Text = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public MyGridControl() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public MyGridControl(IContainer container) {
|
||||
container.Add(this);
|
||||
InitializeComponent();
|
||||
|
||||
myContainer = container;
|
||||
|
||||
//数据列表初始化
|
||||
this.dgv = new GridControl();
|
||||
|
||||
//this.dgv.MainView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||
//this.dgv.MainView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
//this.dgv.EditMode = DataGridViewEditMode.EdictProgrammatically;
|
||||
//this.dgv.Dock = DockStyle.Fill;
|
||||
//this.dgv.MultiSelect = false;
|
||||
//this.dgv.AllowUserToResizeColumns = false;
|
||||
//this.dgv.AllowUserToResizeRows = false;
|
||||
//this.dgv.RowHeadersVisible = false;
|
||||
//this.dgv.ColumnHeadersVisible = false;
|
||||
//this.dgv.AllowUserToAddRows = false;
|
||||
//this.dgv.GridColor = Color.AliceBlue;
|
||||
//this.dgv.BackgroundColor = Color.AliceBlue;
|
||||
//this.dgv.DataSource = null;
|
||||
//this.dgv.DefaultCellStyle.BackColor = Color.FromArgb(189, 214, 247);
|
||||
//this.dgv.Leave += new EventHandler(SreachDgv_Leave);
|
||||
//this.dgv.CellDoubleClick += new DataGridViewCellEventHandler(Dgv_RowDoubleClick);
|
||||
|
||||
//this.lab = new Label();
|
||||
//this.lab.Visible = false;
|
||||
//this.lab.Location = new Point(5, 5);
|
||||
|
||||
//this.lab.Size = new Size(400, 80);
|
||||
//this.lab.BackColor = Color.AliceBlue;
|
||||
//this.lab.ForeColor = Color.DarkRed;
|
||||
this.lab.BringToFront();
|
||||
|
||||
|
||||
//数据面板初始化
|
||||
this.dgvPanel = new Panel();
|
||||
this.dgvPanel.Visible = false;
|
||||
this.dgvPanel.Size = new System.Drawing.Size(0, 0);
|
||||
this.dgvPanel.Controls.Add(lab);
|
||||
|
||||
//添加数据列表
|
||||
this.dgv.BringToFront();
|
||||
this.dgvPanel.Controls.Add(this.dgv);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user