| | | Forum Newbie
       
Group: Forum Members Last Login: 7/12/2007 2:33:31 PM Posts: 1, Visits: 6 |
| | Hi, i'm completely new to VB but not at all new to programming. I'm trying to create a very basic first program with Visual Basic .Net 2005 but keep getting an error that I have no idea how to handle. My code: Public Class Form1Private mImage As ImagePrivate Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.PaintmImage = Bitmap.FromFile( "C:\valve2.bmp")e.Graphics.DrawImage(mImage, 5, 5) End SubPrivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadEnd SubEnd Class My error: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. This error targets line 4, the "mImage = ..." part. The image exists and is located where I declare it to be. I have a form and a panel in design view. I don't know what else is wrong, but the troubleshooting tells me to use "isolated storage" (no idea what that is) or obtain/follow security permissions. Can anyone help? (When i strip the program down to just that line --the mImage assignment line-- i get the error even then) |
| | | | 
Forum Member
       
Group: Forum Members Last Login: 1/28/2008 9:56:29 PM Posts: 39, Visits: 85 |
| | I started a programming class in school about febuary so I'm fairly new to programming too, I use vb6 (1998), so my code might be right, but instead of putting mimage = bitmap.fromfile..., try this "mimage.picture = loadpicture ("thisfile.bmp"). this is what vb6 requires to change the picture during run time. Hope it works |
| |
|
|