Go to Post ...all that matters in my opinion is how much personal growth each one of you all achieve from being a part of this wonderful organization known as the FIRST robotics program. - Elgin Clock [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-05-2005, 21:44
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
C#

Well I downloaded Microsoft Visual C# 2005 Beta 2 today (for those interested, it's a free version and I definitely recommend you try it out) and so far the learning curve has been minimal. Now I'm stuck on a problem, and searched Google and everywhere else but theres really no good sized, active C# forums. Does anybody know of any? In the meanwhile, I might as well post my question here.

I am trying to enable a timer by pushing the left button on the keyboard. I used MSVC#'s Method Creating tool, so I know the method declarations are right... but it's not working. Here's my code:
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Simulator
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void tmrRobot_Tick(object sender, EventArgs e)
        {
            pictBot.Location = new System.Drawing.Point(100, 100);
        }

        private void frmMain_KeyPress(object sender, KeyPressEventArgs e)
        {
            tmrRobot.Enabled = true;
        }

    }
}
__________________
http://www.mikesorrenti.com/
  #2   Spotlight this post!  
Unread 01-06-2005, 00:38
TimCraig TimCraig is offline
Registered User
AKA: Tim Craig
no team
 
Join Date: Aug 2004
Rookie Year: 2003
Location: San Jose, CA
Posts: 221
TimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to behold
Re: C#

I find www.codeproject.com is a valuable programming resource. Although I don't pay any attention to the toy language C#, I know they have a lot of code samples for it and there's probably a forum.
  #3   Spotlight this post!  
Unread 01-06-2005, 09:40
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: C#

Thanks, for anyone interested I found the problem. I also had a button on my form, which was taking focus away from it. On frmMain I had to set KeyPreview to true, so that way the keypresses are sent to the form first, not the button.
__________________
http://www.mikesorrenti.com/
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 00:18.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi