private void LoadWorkbookView() { //workbook = SpreadsheetGear.Factory.GetWorkbook(this.tmpXlsName); workbook = SpreadsheetGear.Factory.GetWorkbook(); worksheet = workbook.ActiveWorksheet; wbView = new SpreadsheetGear.Windows.Forms.WorkbookView(workbook); wbView.GetLock(); try { SpreadsheetGear.IWorkbookWindowInfo windowInfo = wbView.ActiveWorkbookWindowInfo; windowInfo.DisplayWorkbookTabs = false; worksheet.WindowInfo.Zoom = 100; wbView.Parent = this;; wbView.BringToFront(); wbView.Dock = DockStyle.Fill; wbView.CellBeginEdit += new CellBeginEditEventHandler(wbView_CellBeginEdit); wbView.RangeChanged += new RangeChangedEventHandler(wbView_RangeChanged); wbView.RangeSelectionChanged += wbView_RangeSelectionChanged; } finally { wbView.ReleaseLock(); } }
//private void Load(object sender, EventArgs e) //{ // Encode.EncodeData = new SSIT.Bread.ClientEncodeData(); // EncodeCollection<SSIT.QM.CheckInterface.SampleItemOrder> ec = // SSIT.EncodeBase.Encode.EncodeData.GetDatas<SSIT.QM.CheckInterface.SampleItemOrder>(); // SampleItemOrder obj = ec[4]; // LoadBarcode(obj, new string[] { "RS", "TA", "TSO2", "VA", "YSO2", "106项农残", "Alc", "CO2", "Cu", "DE", "Fe", "FSO2", "Pb", "PH", "RS", "TA", "TCA", "TCA释放量", "TSO2", "VA", "YSO2", "氨基甲酸乙酯", "拔塞力", "百粒重" }); //} public void InitUI() { wbv.GetLock(); SpreadsheetGear.IWorkbookWindowInfo windowInfoBook = wbv.ActiveWorkbookWindowInfo; windowInfoBook.DisplayHorizontalScrollBar = !windowInfoBook.DisplayHorizontalScrollBar; windowInfoBook.DisplayVerticalScrollBar = !windowInfoBook.DisplayVerticalScrollBar; windowInfoBook.DisplayWorkbookTabs = !windowInfoBook.DisplayWorkbookTabs; SpreadsheetGear.IWorksheetWindowInfo windowInfoSheet = wbv.ActiveWorksheetWindowInfo; windowInfoSheet.DisplayHeadings = !windowInfoSheet.DisplayHeadings; SpreadsheetGear.IPageSetup pageSetup = wbv.ActiveWorksheet.PageSetup; pageSetup.FitToPages = true; pageSetup.FitToPagesTall = 1; pageSetup.FitToPagesWide = 1; pageSetup.CenterHorizontally = true; pageSetup.CenterVertically = true; pageSetup.Orientation = PageOrientation.Portrait; pageSetup.BottomMargin = 1; pageSetup.LeftMargin = 1; pageSetup.RightMargin = 1; pageSetup.TopMargin = 1; wbv.ReleaseLock(); }