http://www.blueshop.com.tw/board/FUM20050124191756KKC/BRD200707131926393KJ.html http://homepage1.nifty.com/yamato/texts/memorandum/memo5_1.html Globa private ToolStripButton tbs = new ToolStripButton(); private void preview_Click(object sender, EventArgs e) //normal buttion click { tbs.Text = “Print”; tbs.Click += new EventHandler(tbs_Click);  PrintPreviewDialog print_preview = new PrintPreviewDialog(); ((ToolStripButton)((ToolStrip)print_preview.Controls[1]).Items[0]).Visible = false; ((ToolStrip)print_preview.Controls[1]).Items.Insert(0, tbs);  print_preview.Document = printDocument1; //PrintPreviewDialog print_preview.ShowDialog(); } private void tbs_Click(object sender, EventArgs e) { MessageBox.Show(“dd”); //now here can put PrintDialog code  var print_dialog = new PrintDialog(); print_dialog.Document = printDocument1;  if (print_dialog.ShowDialog() == DialogResult.

繼續閱讀

最近再試,發現 Math.round() 又正確了….奇了! 116.55出來是116 ========== 一般的說法是Math.round() 但實際上跑 decimal num = 116.55 Math.round(num) 結果是 117 這是錯的!! 所以 參考這個 https://windperson.wordpress.com/2013/02/21/c-%E5%B0%87%E5%B0%8F%E6%95%B8%E9%BB%9E%E5%BE%8C%E6%8C%87%E5%AE%9A%E4%BD%8D%E6%95%B8%E7%9A%84%E6%95%B8%E5%80%BC%E5%8E%BB%E6%8E%89%E7%9A%84%E6%96%B9%E6%B3%95/ 改成 decimal GetFrag1(decimal input,int digit) //這個四捨六入五成雙才正確 { if (digit < 0) { return Math.Floor(input); } double pow = Math.Pow(10, digit); decimal sign = input >= 0 ? 1 : -1; return sign * Math.Floor(sign * input * (decimal)pow) / (decimal)pow; } GetFrag1(num, 0).ToString() 結果 116

繼續閱讀

.NET Framework 4.6.1正式版完整離線安裝包 http://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe https://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe

繼續閱讀

作者的圖片

Sue boy

Sueboy Can support You

CIO

Taiwan