[ pubps @ 23.03.2011. 17:18 ] @
Pozdrav,
znam da je ova tema mnogo puta postavljana ali mene interesuje konkretan odgovor na sledece pitanje:

Zeleo bih da naucim C#...imam nekoliko knjiga i interesuje me koja je od njih najbolja za apsolutne pocetnike (kad kazem apsolutne mislim na APSOLUTNE-nikad u zivotu nisam imao dodirne tacke sa programiranjem)

Od knjiga imam:

1. Beginning C# 3.0 - Jack Purdum
2. Sams teach yourself Visual C # 2010 in 24 Hours
3. Beginning Visual C# 2010 - Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner
4. Microsoft Visual C# Step by Step - John Sharp

i sve ovo isto za verziju C# 2008

unapred hvala na odgovoru...ako neko ima neku knjigu na nasem jeziku bio bih mu zahvalan da mi je posalje na mail
[ AMD guy @ 23.03.2011. 17:33 ] @
Moj glas ide ovome pored C# te i uci objektno-orijentisanom programiranju.
A posle toga malo obimnija knjiga C# 4.0 Unleashed

I ako hoces
C# yellow book skini ovu verziju
[ pubps @ 23.03.2011. 17:42 ] @
Puno hvala
[ pubps @ 25.03.2011. 13:02 ] @
gde gresim i sta je u pitanju....pomoc

Ovo je pisano u VS C# 2008...



using System;
using System.Windows.Forms;

public class frmMain : Form
{
private Label label2;
private Label label3;
private Label Label4;
private Label label5;
private TextBox txtName;
private TextBox txtAdress;
private TextBox txtCity;
private TextBox txtState;
private TextBox txtZip;
private TextBox txtResult;
private Button btnDisplayOutput;
private Button btnExit;
private Label label1;
#region Windowscode
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.Label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.txtAdress = new System.Windows.Forms.TextBox();
this.txtCity = new System.Windows.Forms.TextBox();
this.txtState = new System.Windows.Forms.TextBox();
this.txtZip = new System.Windows.Forms.TextBox();
this.txtResult = new System.Windows.Forms.TextBox();
this.btnDisplayOutput = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label1.Location = new System.Drawing.Point(13, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(75, 20);
this.label1.TabIndex = 0;
this.label1.Text = "Name:";
//
// label2
//
this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label2.Location = new System.Drawing.Point(13, 55);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(75, 20);
this.label2.TabIndex = 1;
this.label2.Text = "Adress:";
//
// label3
//
this.label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label3.Location = new System.Drawing.Point(13, 97);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(75, 20);
this.label3.TabIndex = 2;
this.label3.Text = "City";
//
// Label4
//
this.Label4.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.Label4.Location = new System.Drawing.Point(12, 137);
this.Label4.Name = "Label4";
this.Label4.Size = new System.Drawing.Size(75, 20);
this.Label4.TabIndex = 3;
this.Label4.Text = "State";
//
// label5
//
this.label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label5.Location = new System.Drawing.Point(12, 181);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(75, 20);
this.label5.TabIndex = 4;
this.label5.Text = "Zip";
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(127, 18);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(142, 20);
this.txtName.TabIndex = 5;
//
// txtAdress
//
this.txtAdress.Location = new System.Drawing.Point(126, 55);
this.txtAdress.Name = "txtAdress";
this.txtAdress.Size = new System.Drawing.Size(143, 20);
this.txtAdress.TabIndex = 6;
//
// txtCity
//
this.txtCity.Location = new System.Drawing.Point(125, 99);
this.txtCity.Name = "txtCity";
this.txtCity.Size = new System.Drawing.Size(143, 20);
this.txtCity.TabIndex = 7;
//
// txtState
//
this.txtState.Location = new System.Drawing.Point(126, 137);
this.txtState.Name = "txtState";
this.txtState.Size = new System.Drawing.Size(139, 20);
this.txtState.TabIndex = 8;
//
// txtZip
//
this.txtZip.Location = new System.Drawing.Point(125, 181);
this.txtZip.Name = "txtZip";
this.txtZip.Size = new System.Drawing.Size(140, 20);
this.txtZip.TabIndex = 9;
//
// txtResult
//
this.txtResult.Location = new System.Drawing.Point(13, 232);
this.txtResult.Multiline = true;
this.txtResult.Name = "txtResult";
this.txtResult.ReadOnly = true;
this.txtResult.Size = new System.Drawing.Size(254, 39);
this.txtResult.TabIndex = 10;
//
// btnDisplayOutput
//
this.btnDisplayOutput.Location = new System.Drawing.Point(19, 303);
this.btnDisplayOutput.Name = "btnDisplayOutput";
this.btnDisplayOutput.Size = new System.Drawing.Size(51, 21);
this.btnDisplayOutput.TabIndex = 11;
this.btnDisplayOutput.Text = "&Display";
this.btnDisplayOutput.UseVisualStyleBackColor = true;
this.btnDisplayOutput.Click += new System.EventHandler(this.btnDisplayOutput_Click);
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(183, 304);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(52, 19);
this.btnExit.TabIndex = 12;
this.btnExit.Text = "E&xit";
this.btnExit.UseVisualStyleBackColor = true;
//
// frmMain
//
this.ClientSize = new System.Drawing.Size(292, 338);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnDisplayOutput);
this.Controls.Add(this.txtResult);
this.Controls.Add(this.txtZip);
this.Controls.Add(this.txtState);
this.Controls.Add(this.txtCity);
this.Controls.Add(this.txtAdress);
this.Controls.Add(this.txtName);
this.Controls.Add(this.label5);
this.Controls.Add(this.Label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "frmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Mailing Label program";
this.ResumeLayout(false);
this.PerformLayout();

}
#endregion

public frmMain()
{
InitializeComponent();
}
public static void Main()
{
frmMain main = new frmMain();
Application.Run(main);
}

private void btnDisplayOutput_Click(object sender, EventArgs e)
{
String buffer;

buffer = "Mailing Label:" + Environment.NewLine +
Environment.NewLine;
buffer = buffer + " Name: " + txtName.Text +
Environment.NewLine;
buffer = buffer + " Adress: " + txtAdress.Text +
Environment.NewLine;
buffer = buffer + " City " + txtCity.Text +
Environment.NewLine;
buffer = buffer + " State " + txtState.Text +
Environment.NewLine;
buffer = buffer + " Zip " + txtZip.Text +
Environment.NewLine;
txtDisplayOutput.Text = buffer;
}
}



i dole u greskama mi prijavljuje sledecu gresku:


Error 1 The name 'txtDisplayOutput' does not exist in the current context 196 9 MailingLabel....to je ovaj zadnji red...

ako umesto txtDisplayOutput.Text = buffer; stavim txtResult.Text = buffer; program se pokrene ali mi se u mailing listi ispisuje samo Mailing Label: i nista vise, iako sam upisao i ime i prezime, i adresu...itd...trebao bi da izbaci u textbox-u sve podatke a ne samo naslov....


HVALA UNAPRED
[ AMD guy @ 25.03.2011. 13:19 ] @
Pa jednostavno.
Nisi definisao txtDisplayOutput u kodu, proveri jos jednom pa ces videti da nemas definisano txtDisplayOutput u kodu nigde.
[ pubps @ 25.03.2011. 13:34 ] @
Pretpostavio sam da je to problem ali gde bih to trebao da definisem i na koj nacin...(tooootalni sam pocetnik u ovome i imam zelju da naucim, ali bi mi mala pomoc dobrodosla cisto da shvatim gde bi to trebalo da stoji i kako - cisto da bih znao)...unapred hvala
[ AMD guy @ 25.03.2011. 13:50 ] @
Pa kao sto i druge sto si definisao.
Ili uz pomoc dizajnera prevuci textbox i promeni mu name property u txtDisplayOutput.

Jedno pitanje, odakle taj primer jel iz neke knjige ili si sam to smislio.
[ pubps @ 25.03.2011. 13:58 ] @
Primer je iz knjige beginning C# 3.0 - Jack Purdum...
[ pubps @ 25.03.2011. 15:25 ] @
Pronasao sam u cemu je problem...textbox je bio mali i kada sam ga povecao onda su se prikazali svi podaci...hvala svima na trudu....mada ne znam kako da definisem button Exit da izvrsi komandu tj. da ugasi prozor kad kliknem na Exit
[ AMD guy @ 25.03.2011. 15:28 ] @
Pa stavi button nazovi ga exit i u button_event stavi Close();
[ pubps @ 25.03.2011. 16:05 ] @
nadjoh kako...samo sam trebao staviti this.Close(); ...hvala puno