🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Jak dodać zdarzenie KeyDown do Panel

#22206
From: akowal
Date: Sat, 11 Jun 2011 08:26
43 lines
2814 bytes
To jest cały program

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;

namespace Jeden
{
		public partial class Form1 : Form
		{
				public Form1()
				{
						InitializeComponent();
				}

				private void Form1_Load(object sender, EventArgs e)
				{
						this.ActiveControl = this.panel1;
						this.panel1.KeyDown += new KeyEventHandler(panel1_KeyDown);
				}

				void panel1_KeyDown(object sender, KeyEventArgs e)
				{
						String s = e.KeyCode.ToString();
						e.Handled = true;
						MessageBox.Show(s);
				}
		}
}


Na Form1 jest Panel i to wszystko. Chciałbym na panellu rysowac
figurę, a badać klawisz Delete po to aby
można narysowaną fiigurę usunąć. Stąd takie proste ćwiczenie, ale nie
rrozumieem dlaczego MessageBoox.Show
wywwołuje mmi się dwa razy. e.Handled = true nie pomaga.

Pozdrawiam
Technical Details
Message-ID: <bdc9793e-ee0f-41ea-b007-e9c430b34088@16g2000yqy.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!goblin2!goblin.stu.neva.ru!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!16g2000yqy.googlegroups.com!not-for-mail
References: <01ebc3ac-0c03-4fab-b148-767902beaa84@j31g2000yqe.googlegroups.com> <28523cf1-ce13-4f33-a533-388e545ca2b3@d1g2000yqe.googlegroups.com> <a85d1a36-1708-4835-a39e-6f0f5aab3c37@z13g2000yqg.googlegroups.com> <09ccfcea-a2b4-4a49-b874-fcfb9f53a424@m4g2000yqk.googlegroups.com>

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!goblin2!goblin.stu.neva.ru!feeder1.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!16g2000yqy.googlegroups.com!not-for-mail
From: akowal <akrunner78@gmail.com>
Newsgroups: alt.pl.comp.lang.csharp
Subject: Re: Jak dodać zdarzenie KeyDown do Panel
Date: Sat, 11 Jun 2011 01:26:19 -0700 (PDT)
Organization: http://groups.google.com
Lines: 44
Message-ID: <bdc9793e-ee0f-41ea-b007-e9c430b34088@16g2000yqy.googlegroups.com>
References: <01ebc3ac-0c03-4fab-b148-767902beaa84@j31g2000yqe.googlegroups.com> <28523cf1-ce13-4f33-a533-388e545ca2b3@d1g2000yqe.googlegroups.com> <a85d1a36-1708-4835-a39e-6f0f5aab3c37@z13g2000yqg.googlegroups.com> <09ccfcea-a2b4-4a49-b874-fcfb9f53a424@m4g2000yqk.googlegroups.com>
NNTP-Posting-Host: 93.179.248.12
Mime-Version: 1.0
X-Trace: posting.google.com 1307780779 30812 127.0.0.1 (11 Jun 2011 08:26:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 11 Jun 2011 08:26:19 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 16g2000yqy.googlegroups.com; posting-host=93.179.248.12; posting-account=ublW0AoAAAAdUJCK4akHynb0QwkX0WmI
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: ARLUEHNKC
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; eSobiSubscriber 2.0.4.16; .NET CLR 1.1.4322; InfoPath.1; .NET4.0C; .NET4.0E),gzip(gfe)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit