Skip to main content

Posts

Showing posts from August, 2014

Simple Calculator C#

Code : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Calculator { public partial class Form1 : Form { string input = string.Empty; string operand1 = string.Empty; string operand2 = string.Empty; char operation; double result = 0.000; public Form1() { InitializeComponent(); } private void zero_Click(object sender, EventArgs e) { this.hasil.Text = ""; input += "0"; this.hasil.Text += input; } private void dot_Click(object sender, EventArgs e) { this.hasil.Text = ""; input += "."; this.hasil.Text += input; } private void cancel_Click(object sender, EventArgs...

Word to PDF C#

Code : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Microsoft.Office.Interop.Word; using Microsoft.Office.Interop; namespace WordToPdf { public partial class WordPDF : Form { public WordPDF() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //set filter openFileDialog1.Filter = "Document Word|*.doc;*.docx"; openFileDialog1.FilterIndex = 1; openFileDialog1.Multiselect = false; openFileDialog1.ShowDialog(); textBox1.Text = openFileDialog1.FileName; } private void button2_Click(object sender, EventArgs e) { saveFileDialog1.Filter = "PDF Format|*.pdf"; saveFileDialog1.Show...