c# not vb.net PrintPreviewDialog PrintDialog 在PreviewDialog中按列印鈕,直接呼叫PrintDialog

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.OK) { printDocument1.Print(); } }

2016-06-01 · 1 min · 72 words · Me

ConfuserEx 保護 C# windows form

https://yck1509.github.io/ConfuserEx/ http://confuser.codeplex.com/ ===== http://www.cnblogs.com/zhangzhi19861216/p/3937434.html

2016-05-10 · 1 min · 4 words · Me

Visual Studio 2015 net 4.6.1 四捨六入五成雙 錯誤

最近再試,發現 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

2016-05-07 · 1 min · 63 words · Me

[轉]Visual Studio程序打包软件——InstallShield(4)

http://blog.csdn.net/luoyouren/article/details/45953171 http://read01.com/78nNN.html

2016-04-05 · 1 min · 2 words · Me

.NET Framework 4.6.1正式版完整離線安裝包

.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

2016-04-05 · 1 min · 5 words · Me