|
-
Nov 8th, 2005, 02:54 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] casting timer object to System.Windows.forms
Hi. I want to use a timer object from system.windows.forms. However, I also use threads, and I use the namespace: using System.Threading; Just that when I declare a timer object as:
Timer updateTimer;
I get an errro saying that it is ambigious. Is thhere some way to cast the Timer object to System.Windows.Form?
Jennifer
-
Nov 8th, 2005, 03:01 AM
#2
Thread Starter
Hyperactive Member
Re: casting timer object to System.Windows.forms
Sorry guys. I found it out. I could miss silly mistake sometimes. Its
System.Windows.Forms.Timer updateTimer;
I'm still learning
Jennifer
-
Nov 8th, 2005, 09:10 AM
#3
Re: casting timer object to System.Windows.forms
You can use a "using" directive to create an alias for namespace, to make it a little easier.
Code:
// in namespace
using WinForms = System.Windows.Forms;
// in class
WinForms.Timer updateTimer;
-
Nov 10th, 2005, 07:57 AM
#4
Thread Starter
Hyperactive Member
Re: casting timer object to System.Windows.forms
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|