🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.pl.comp.lang.csharp
Article #22189

Re: znow sie pogubilem

#22189
From: Maciej Rychter
Date: Mon, 06 Jun 2011 09:50
95 lines
3916 bytes
On 6 Cze, 10:45, "qaz" <qazvox...@wp.pl> wrote:
> Użytkownik "qaz" <qazvox...@wp.pl> napisał w wiadomościnews:4dec8f29$0$2439$65785112@news.neostrada.pl...
>
>
>
>
>
>
>
>
>
> > Użytkownik "Maciej Rychter" <rychter.mac...@gmail.com> napisał w
> > wiadomości
> >news:f86bf68d-f9ee-4c03-b0a7-bfb9411474b7@y12g2000yqh.googlegroups.com...
> >>On 3 Cze, 12:17, "qaz" <qazvox...@wp.pl> wrote:
> >>> U ytkownik "Maciej Rychter" <rychter.mac...@gmail.com> napisa w wiadomo
> >>> cinews:f0d2b8ca-4ff0-44bc-a255-bc7e72ee7eb7@s2g2000yql.googlegroups.com...
> >>> w form1 pewnie masz buttona na kt rego clicku robisz pewnie co
> >>> takiego
>
> >>> var f2 = new Form2();
> >>> if (f2.showdialog() == DialogResult.ok)
> >>> {
> >> >// co tam zr b z f2.SelectedRow
>
> >>> }
>
> >>> eby to zadzia a o zr b sobie w klasie Form2 publiczn w asciwo pod
> >>> tytu em SelectedRow
>
> >> >Jak to si robi ?
> >> >(np niech to b dzie string, kt ry odczytam z form1)
>
> >>A umiesz dodawać właściwości do klasy?
> >>To najpierw sobie poczytaj o tym, a potem pytaj.
>
> > Dzieki, poczytalem i dalej mam:
> > public partial class form1 : Form
> > {
> >  public string psWk{ get; set; }
> >  public form1()
> >  {
> >    InitializeComponent();
> >  }
> >  private void bOk_Click(object sender, EventArgs e)
> >  {
> >  this.psWk = this.tbIden.Text;
> >  this.Close();
> >  }
>
> > a z form2 nie widzę form1.psWk - i tu jest moje pogubienie
> > qaz
>
> Ok, juz dalem rade:
>
> public partial class form1 : Form
> {
>   public static string psWk{ get; set; }  //dodane "static"
>   public form1()
>   {
>     InitializeComponent();
>   }
>   private void bOk_Click(object sender, EventArgs e)
>   {
>   form1.psWk = this.tbIden.Text;        //zamiast "this" - "form1"
>   this.Close();
>   }
>
> teraz w form2 widzę form1.psWk :-) ( po form1.ShowDialog() )
>
> --
> pzdr
>     qaz

Coś tu mocno namieszałeś.
Trochę to przeredaguje żeby to miało większy sens:

<kod>

public partial class form1 : Form
{
  public string psWk { get; private set; }  //usunięte "static"

  public form1()
  {
    InitializeComponent();
  }

  private void bOk_Click(object sender, EventArgs e)
  {
  psWk = this.tbIden.Text;        //zamiast "this" - "form1"
  this.Close();
  }

</kod>
Technical Details
Message-ID: <61a8bb4d-9345-4a5a-a1d5-ca0351595fe2@e35g2000yqc.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!postnews.google.com!e35g2000yqc.googlegroups.com!not-for-mail
References: <4de88723$0$2440$65785112@news.neostrada.pl> <f0d2b8ca-4ff0-44bc-a255-bc7e72ee7eb7@s2g2000yql.googlegroups.com> <4de8b4ad$0$2497$65785112@news.neostrada.pl> <f86bf68d-f9ee-4c03-b0a7-bfb9411474b7@y12g2000yqh.googlegroups.com> <4dec8f29$0$2439$65785112@news.neostrada.pl> <4dec9398$0$2486$65785112@news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin1!goblin.stu.neva.ru!postnews.google.com!e35g2000yqc.googlegroups.com!not-for-mail
From: Maciej Rychter <rychter.maciej@gmail.com>
Newsgroups: alt.pl.comp.lang.csharp
Subject: Re: znow sie pogubilem
Date: Mon, 6 Jun 2011 02:50:18 -0700 (PDT)
Organization: http://groups.google.com
Lines: 101
Message-ID: <61a8bb4d-9345-4a5a-a1d5-ca0351595fe2@e35g2000yqc.googlegroups.com>
References: <4de88723$0$2440$65785112@news.neostrada.pl> <f0d2b8ca-4ff0-44bc-a255-bc7e72ee7eb7@s2g2000yql.googlegroups.com> <4de8b4ad$0$2497$65785112@news.neostrada.pl> <f86bf68d-f9ee-4c03-b0a7-bfb9411474b7@y12g2000yqh.googlegroups.com> <4dec8f29$0$2439$65785112@news.neostrada.pl> <4dec9398$0$2486$65785112@news.neostrada.pl>
NNTP-Posting-Host: 80.94.182.138
Mime-Version: 1.0
X-Trace: posting.google.com 1307353818 2943 127.0.0.1 (6 Jun 2011 09:50:18 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 6 Jun 2011 09:50:18 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: e35g2000yqc.googlegroups.com; posting-host=80.94.182.138; posting-account=0LtQXAoAAABsec8yh6dn4H8zU73p878u
User-Agent: G2/1.0
X-HTTP-Via: 1.1 webwasher (Webwasher 6.8.7.9979)
X-Google-Web-Client: true
X-Google-Header-Order: ASELNKCHRUV
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.71 Safari/534.24,gzip(gfe)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit