Click here to Skip to main content
15,914,399 members
Home / Discussions / C#
   

C#

 
Questionhow to add a new option to Windows textbox context menu Pin
Anonymous17-Feb-05 1:16
Anonymous17-Feb-05 1:16 
AnswerRe: how to add a new option to Windows textbox context menu Pin
Radgar18-Feb-05 0:54
Radgar18-Feb-05 0:54 
GeneralCreate .txt file Pin
BH Serpa16-Feb-05 23:43
BH Serpa16-Feb-05 23:43 
GeneralRe: Create .txt file Pin
Stefan Troschuetz17-Feb-05 0:01
Stefan Troschuetz17-Feb-05 0:01 
GeneralRe: Create .txt file Pin
BH Serpa17-Feb-05 0:42
BH Serpa17-Feb-05 0:42 
GeneralRe: Create .txt file Pin
Stefan Troschuetz17-Feb-05 1:01
Stefan Troschuetz17-Feb-05 1:01 
GeneralRe: Create .txt file Pin
BH Serpa17-Feb-05 19:50
BH Serpa17-Feb-05 19:50 
GeneralRe: Create .txt file Pin
Stefan Troschuetz17-Feb-05 23:24
Stefan Troschuetz17-Feb-05 23:24 
alancatovic wrote:
and press button I want that vales to be written

You have to define an event handler for the Click event of that Button.
If your using Visual Studio select the button in the Form designer, go to the properties window, click on the yellow bolt to display available events of this button and double-click on Click. The designer creates the event handler, subscribes it and jumps to the event handler in the code file. Into the event handler you put the code, I gave you yesterday.
If you don't use an IDE, you have to insert the following code on your own:
// Put in constructor of form
this.button1.Click += new EventHandler(this.button1_Click);
// Put inside form definition
void button1_Click(object sender, EventArgs e)
{
  // Here goes the code to save the file.
}


alancatovic wrote:
can I somehow restrict text field to except just text or just numbers

You can. Subscribe an event handler for the KeyPress event of each TextBox and insert the following code.
void textBoxXX_KeyPress(object sender, KeyPressEventArgs e)
{
  // Check whether pressed character is number or not, and eventually cancel the event.
  if (e.KeyChar.IsNumber)// if (!e.KeyChar.IsNumber)
    e.Handled = true;
}








www.troschuetz.de
GeneralRe: Create .txt file Pin
18-Feb-05 0:23
suss18-Feb-05 0:23 
GeneralRe: Create .txt file Pin
BH Serpa18-Feb-05 0:53
BH Serpa18-Feb-05 0:53 
GeneralRe: Create .txt file Pin
Stefan Troschuetz18-Feb-05 1:06
Stefan Troschuetz18-Feb-05 1:06 
GeneralRe: Create .txt file Pin
Stefan Troschuetz18-Feb-05 0:58
Stefan Troschuetz18-Feb-05 0:58 
GeneralRe: Create .txt file Pin
BH Serpa18-Feb-05 1:16
BH Serpa18-Feb-05 1:16 
QuestionMDI Application. Can't VS.Net do that ? Pin
nguyennp16-Feb-05 23:42
nguyennp16-Feb-05 23:42 
AnswerRe: MDI Application. Can't VS.Net do that ? Pin
Kodanda Pani17-Feb-05 0:28
Kodanda Pani17-Feb-05 0:28 
GeneralRe: MDI Application. Can't VS.Net do that ? Pin
nguyennp17-Feb-05 16:39
nguyennp17-Feb-05 16:39 
QuestionHow to retrieve SQL Server Names and Database Names using C#? Pin
pubududilena16-Feb-05 23:38
pubududilena16-Feb-05 23:38 
AnswerRe: How to retrieve SQL Server Names and Database Names using C#? Pin
exhaulted17-Feb-05 3:36
exhaulted17-Feb-05 3:36 
GeneralRe: How to retrieve SQL Server Names and Database Names using C#? Pin
J4amieC17-Feb-05 3:58
J4amieC17-Feb-05 3:58 
GeneralRe: How to retrieve SQL Server Names and Database Names using C#? Pin
exhaulted17-Feb-05 4:06
exhaulted17-Feb-05 4:06 
GeneralRe: How to retrieve SQL Server Names and Database Names using C#? Pin
J4amieC17-Feb-05 5:11
J4amieC17-Feb-05 5:11 
General:confused:Project Server 2003 Pin
sathe siddharth16-Feb-05 20:07
susssathe siddharth16-Feb-05 20:07 
GeneralDatabinding to class properties Pin
fodonnel16-Feb-05 17:08
fodonnel16-Feb-05 17:08 
GeneralRe: Databinding to class properties Pin
Heath Stewart16-Feb-05 21:40
protectorHeath Stewart16-Feb-05 21:40 
GeneralRe: Databinding to class properties Pin
fodonnel17-Feb-05 10:53
fodonnel17-Feb-05 10:53 

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.