private void paperSearchLook_EditValueChanged(object sender, EventArgs e) { if (_isLoaded && (int)paperSearchLook.EditValue > 0) { SingleOffset.FkPaper = (int)paperSearchLook.EditValue; var pap = new Paper { Identity = (int)paperSearchLook.EditValue }; pap.LoadSingleObject(); paperDesc.Text = string.Format("ab 1 Bogen:{1}.00 Fr.{0}ab {2} Bogen: {3}.00 Fr.{0}ab {4} Bogen: {5}.00 Fr.{0}ab {6} Bogen: {7}.00 Fr.", Environment.NewLine, pap.Price1, pap.Amount1, pap.Price2, pap.Amount2, pap.Price3, pap.Amount3, pap.Price4); pricePaper.Value = pap.Price1; SingleOffset.PaperPrice = pap.Price1; var comp1 = (int)(pap.SizeH / printFormatWidth.Value) * (int)(pap.SizeW / printFormatHeight.Value); var comp2 = (int)(pap.SizeH / printFormatHeight.Value) * (int)(pap.SizeW / printFormatWidth.Value); SingleOffset.PaperUsePer = (comp1 > comp2 ? comp1 : comp2); usePerSheet.Value = comp1 > comp2 ? comp1 : comp2; paperDesc.Update(); DrawPaperSheet(paperSheetPanel.CreateGraphics()); CalculatePaperQuantity(); } else { paperDesc.Text = string.Empty; } }