eramgarden Posted March 18, 2004 Posted March 18, 2004 I'm working on a Image application... I'm putting the code in a class: But get "declaration expected" for the variable "g" Imports System Imports System.Windows.Forms Imports System.Drawing Imports System.Net Imports System.IO Public Class Image Dim bmp As Bitmap = New Bitmap("Image.tif") Dim g As Graphics = Graphics.FromImage(bmp) Dim boldFont As Font = New Font("Times New Roman", 10, FontStyle.Bold) g.DrawString("I'm A Button!", boldFont, Brushes.Black, 10.0f, 10.0f) End Class any ideas? Quote
Administrators PlausiblyDamp Posted March 18, 2004 Administrators Posted March 18, 2004 The line highlighted needs to be executed from within a Method (function or sub) you cannot just execute code directly at the class level like that. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.