I've recently decided to make a simple bank application for my self but due to the fact, That I lost my work on a previous application, I've kind of forgoten the simple code for Reading and Writing From a maskedTextBox.
Basically I just need help with the part,
Writing to a Textbox without showing any...
System.Info Text: whatever i put in the masked textbox.
I've Writen code to prove that its not homework, I'm doing this, just to get my C# Abilities back again
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MyBank
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
TextWriter tw = new StreamWriter("C:\\test.txt");
private void button1_Click(object sender, EventArgs e)
{
// write a line of text to the file
tw.WriteLine("" + maskedTextBox1);
// close the stream
tw.Close();
}
private void maskedTextBox1_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
{
// write a line of text to the file
tw.WriteLine("" + maskedTextBox1);
// close the stream
tw.Close();
}
}
}
Thanks....
- Owen
This post has been edited by owen_a: 07 October 2009 - 10:23 AM

New Topic/Question
Reply




MultiQuote





|