You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
using DevExpress.XtraTab;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace WellWorkDataUI
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class WellDataTableControl : DevExpress.XtraEditors.XtraUserControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public string tableName;
|
|
|
|
|
|
public string wellName;
|
|
|
|
|
|
public string chsTableName;
|
|
|
|
|
|
public int nodeType; //双击节点的类型
|
|
|
|
|
|
public WellDataTableControl()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AddWellDataView(bool bEnableToolBar = true)
|
|
|
|
|
|
{
|
|
|
|
|
|
XtraTabPage tap = new XtraTabPage();
|
|
|
|
|
|
tap.ShowCloseButton = DevExpress.Utils.DefaultBoolean.True;
|
|
|
|
|
|
tap.Appearance.Header.TextOptions.Trimming = DevExpress.Utils.Trimming.None;
|
|
|
|
|
|
FrmDataViewer frm = new FrmDataViewer(chsTableName, wellName, "", bEnableToolBar);
|
|
|
|
|
|
// this.panel1.Controls.Add(frm);
|
|
|
|
|
|
|
|
|
|
|
|
frm.FormBorderStyle = FormBorderStyle.None;
|
|
|
|
|
|
frm.TopLevel = false;
|
|
|
|
|
|
frm.Dock = DockStyle.Fill;
|
|
|
|
|
|
frm.Show();
|
|
|
|
|
|
frm.ShowData();
|
|
|
|
|
|
tap.Controls.Add(frm);
|
|
|
|
|
|
this.xtraTabControl1.TabPages.Add(tap);
|
|
|
|
|
|
this.xtraTabControl1.SelectedTabPage = tap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void XtraTabControl1_CloseButtonClick(object sender, EventArgs e)//不起作用,不知道怎么回事
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs EArg = (DevExpress.XtraTab.ViewInfo.ClosePageButtonEventArgs)e;
|
|
|
|
|
|
string name = EArg.Page.Text;//得到关闭的选项卡的text
|
|
|
|
|
|
foreach (XtraTabPage page in xtraTabControl1.TabPages) //遍历得到和关闭选项卡一样的text
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Text == name)
|
|
|
|
|
|
{
|
|
|
|
|
|
xtraTabControl1.TabPages.Remove(page);
|
|
|
|
|
|
page.Dispose();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void xtraTabControl1_SelectedPageChanged(object sender, TabPageChangedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|