Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Strange error when trying to use the System.Drawing.Font class
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Richie P  
View profile  
 More options Mar 2 2005, 5:38 pm
From: "Richie P" <reflex....@ntlworld.com>
Date: Wed, 02 Mar 2005 14:38:16 -0800
Local: Wed, Mar 2 2005 5:38 pm
Subject: Strange error when trying to use the System.Drawing.Font class
Hi

I was trying out the drawing functions in the .NET library and have
come across something quite strange. I have tried everything I can
think of so I'v decided to post my problem here.

When I try to compile the following code I get this error "It is not
possible to invoke an expression of type 'System.Drawing.Font'". Is
this something I have done? or is it a bug in Boo? I presume it's
possible to use the Font constructors in C#.

The code:

import System
import System.Windows.Forms
import System.Drawing
import System.Drawing.Drawing2D
import System.Drawing.Imaging
import System.Drawing.Text

class Woo(Form):
        font as Font

        def constructor():
                super()
                font = Font(FontFamily("Times New Roman"), 24, FontStyle.Regular,
GraphicsUnit.Pixel)

        override def OnPaint(e as PaintEventArgs):
                g = e.Graphics
                g.DrawLine(Pens.Orange, Point(100, 100), Point(0, 0))
                g.DrawString("asdf", font, Brushes.Chartreuse, 50, 50)

woo = Woo(Text: "wooooooo")  
woo.ShowDialog()


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bet's On!  
View profile  
 More options Mar 2 2005, 6:04 pm
From: Bet's On! <l33t...@gmail.com>
Date: Wed, 2 Mar 2005 18:04:11 -0500
Local: Wed, Mar 2 2005 6:04 pm
Subject: Re: Strange error when trying to use the System.Drawing.Font class
Unfortunately you have to prepend "Font" with "System.Drawing" because
the class you're toying with already has a member named font--and Boo
thinks you're trying to instanize that 'Font' instead of the
'System.Drawing.Font'


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richie P  
View profile  
 More options Mar 3 2005, 2:12 pm
From: "Richie P" <reflex....@ntlworld.com>
Date: Thu, 03 Mar 2005 11:12:10 -0800
Local: Thurs, Mar 3 2005 2:12 pm
Subject: Re: Strange error when trying to use the System.Drawing.Font class
What the... Oh I see Form already has a member called Font, I blame
Microsoft.

Thanks for the help and the Gmail account.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google