Click here to Skip to main content
15,917,793 members
Home / Discussions / C#
   

C#

 
QuestionAuto refresh web page code Pin
madhu Rao7-Nov-08 19:16
madhu Rao7-Nov-08 19:16 
AnswerRe: Auto refresh web page code Pin
AprNgp7-Nov-08 19:30
AprNgp7-Nov-08 19:30 
AnswerRe: Auto refresh web page code Pin
sph3rex8-Nov-08 5:35
sph3rex8-Nov-08 5:35 
AnswerRe: Auto refresh web page code Pin
Muammar©9-Nov-08 0:22
Muammar©9-Nov-08 0:22 
QuestionFormatting inside Rich Text Box Pin
raj2313627-Nov-08 19:10
raj2313627-Nov-08 19:10 
GeneralRe: Formatting inside Rich Text Box Pin
Luc Pattyn8-Nov-08 3:01
sitebuilderLuc Pattyn8-Nov-08 3:01 
AnswerRe: Formatting inside Rich Text Box Pin
sph3rex8-Nov-08 5:33
sph3rex8-Nov-08 5:33 
QuestionNotepad application code for REDO and FIND Pin
madhu Rao7-Nov-08 19:04
madhu Rao7-Nov-08 19:04 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Microsoft.VisualBasic;
using System.Collections;

namespace Notepad1
{
public partial class formNotepad : Form
{
private string name;

public formNotepad()
{
InitializeComponent();
}

private void btnClear_Click(object sender, EventArgs e)
{
textBox1.Clear();
}

private void btncancel_Click(object sender, EventArgs e)
{

Application.Exit();
}

private void sAVEToolStripMenuItem1_Click(object sender, EventArgs e)
{

if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}

private void sAVEASToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}

}

private void dELETEToolStripMenuItem1_Click(object sender, EventArgs e)
{
textBox1.Clear();
}

private void SELECTALLToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.SelectAll();

}

private void cLOSEToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}

private void uNDOToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.Undo();
}

public void rEDOToolStripMenuItem_Click(object sender, EventArgs e)
{
// The redo code
}

private void NewtoolStripButton1_Click(object sender, EventArgs e)
{
if (!textBox1.Text.Equals(string.Empty))
{
if (MessageBox.Show("Do u want save the text Data", "Notepad", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}
else
textBox1.ResetText();
}
}

private void opentoolStripButton2_Click(object sender, EventArgs e) //image
{

if (!textBox1.Text.Equals(string.Empty))
{
if (MessageBox.Show("Do u want save the text Data", "Notepad", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
else
textBox1.Clear();
}
else
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{

name = openFileDialog1.FileName;
textBox1.Clear();
textBox1.Text = File.ReadAllText(name);
}

}

private void savetoolStripButton3_Click(object sender, EventArgs e) //image
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}

private void deletetoolStripButton4_Click(object sender, EventArgs e) //image
{
textBox1.Clear();
}

private void webtoolStripButton5_Click(object sender, EventArgs e) //image
{

Interaction.Shell("C:\\Program Files\\Opera\\Opera.exe", AppWinStyle.NormalFocus, true, -1);
}

private void toolStripButton1_Click(object sender, EventArgs e) //image
{
textBox1.Copy();
}

private void toolStripButton2_Click(object sender, EventArgs e) //image
{
textBox1.Paste();
}

private void toolStripButton3_Click(object sender, EventArgs e) //image
{
textBox1.Cut();

}

private void fontStyleToolStripMenuItem_Click(object sender, EventArgs e)
{

if (fontDialog1.ShowDialog() == DialogResult.OK)
textBox1.Font = fontDialog1.Font;

}

private void colorToolStripMenuItem_Click(object sender, EventArgs e)
{
if (colorDialog1.ShowDialog() == DialogResult.OK)
textBox1.ForeColor = colorDialog1.Color;
}

private void formNotepad_Load(object sender, EventArgs e)
{

}

private void formNotepad_Resize(object sender, EventArgs e)
{
int frmwid = formNotepad.ActiveForm.Width;
int frmht = formNotepad.ActiveForm.Height;
textBox1.Width = frmwid-10;
textBox1.Height = frmht-90;
}

private void formNotepad_FormClosing(object sender, FormClosingEventArgs e)
{
if (!textBox1.Text.Equals(string.Empty))
{
if (MessageBox.Show("Do u want save the text Data", "Notepad", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
else
Application.Exit();
}
}
else
{
Application.Exit();
}

}

private void WordWrapToolStripMenuItem_Click(object sender, EventArgs e)
{
if (WordWrapToolStripMenuItem.Checked)
textBox1.WordWrap = true;
else
textBox1.WordWrap = false;
}

private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
String str;
str = textBox1.Text;
if (e.KeyChar == 13)
if ((str.CompareTo(textBox1.Text)) == 0)



}

private void textBox2_MouseClick(object sender, MouseEventArgs e)
{
textBox2.Clear();
}

private void mENUToolStripMenuItem_Click(object sender, EventArgs e)
{

}
private void Find_TextChanged(object sender, EventArgs e)
{
// FIND code
}

}
}




Thanks friends

madhu

GeneralRe: Notepad application code for REDO and FIND Pin
Guffa7-Nov-08 21:37
Guffa7-Nov-08 21:37 
AnswerRe: Notepad application code for REDO and FIND Pin
Dave Kreskowiak8-Nov-08 5:39
mveDave Kreskowiak8-Nov-08 5:39 
AnswerRe: Notepad application code for REDO and FIND Pin
Muammar©9-Nov-08 0:25
Muammar©9-Nov-08 0:25 
QuestionHow to convert String to Guid ? Pin
AprNgp7-Nov-08 18:43
AprNgp7-Nov-08 18:43 
AnswerRe: How to convert String to Guid ? Pin
Guffa7-Nov-08 21:38
Guffa7-Nov-08 21:38 
GeneralRe: How to convert String to Guid ? Pin
PIEBALDconsult8-Nov-08 9:22
mvePIEBALDconsult8-Nov-08 9:22 
Questionhow can we find the Installed Path while deploying application Pin
vishnukamath7-Nov-08 18:24
vishnukamath7-Nov-08 18:24 
AnswerRe: how can we find the Installed Path while deploying application Pin
Dave Kreskowiak8-Nov-08 5:00
mveDave Kreskowiak8-Nov-08 5:00 
AnswerRe: how can we find the Installed Path while deploying application Pin
sph3rex8-Nov-08 5:51
sph3rex8-Nov-08 5:51 
Questioncreating discrete histogram : c# & excel programming Pin
raesa7-Nov-08 17:55
raesa7-Nov-08 17:55 
AnswerRe: creating discrete histogram : c# & excel programming Pin
Dave Kreskowiak8-Nov-08 4:38
mveDave Kreskowiak8-Nov-08 4:38 
QuestionPermission assign based on User previllage. Pin
sayemahmed7-Nov-08 16:54
sayemahmed7-Nov-08 16:54 
AnswerRe: Permission assign based on User previllage. Pin
sayemahmed7-Nov-08 17:07
sayemahmed7-Nov-08 17:07 
AnswerRe: Permission assign based on User previllage. Pin
Dave Kreskowiak8-Nov-08 4:35
mveDave Kreskowiak8-Nov-08 4:35 
QuestionXML as database Pin
nelsonpaixao7-Nov-08 15:32
nelsonpaixao7-Nov-08 15:32 
AnswerRe: XML as database Pin
#realJSOP8-Nov-08 0:06
professional#realJSOP8-Nov-08 0:06 
QuestionSave TO xml FROM datagridview Pin
nelsonpaixao7-Nov-08 15:16
nelsonpaixao7-Nov-08 15:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.