473,511 Members | 16,756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

displaying an image in windows form application

1 New Member
hey friends i want to open image in windows from application but it's not showing the image.if any one know the correct answerr plz mentation it....
here is my code/////

Expand|Select|Wrap|Line Numbers
  1. using (OpenFileDialog dlg = new OpenFileDialog())
  2.             {
  3.                 dlg.InitialDirectory = "c:\\";
  4.                 dlg.Title = "Open Image";
  5.                 dlg.Filter = "bmp files (*.bmp)|*.bmp|Jpeg files (*.jpg)|*.jpg|All valid files (*.bmp/*.jpg)|*.bmp/*.jpg";
  6.  
  7.                 if (dlg.ShowDialog() == DialogResult.OK)
  8.                 {
  9.                     PictureBox PictureBox1 = new PictureBox();
  10.                     PictureBox1.Image = new Bitmap(dlg.FileName);
  11.  
  12.                 }
Nov 8 '12 #1
1 2017
Rabbit
12,516 Recognized Expert Moderator MVP
I don't see that you've defined the location and dimensions of the picture box anywhere. And I don't see that you've added it to the controls collection.
Nov 8 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1622
by: David | last post by:
So I'm a new user to Visual Studio .NET. I'm having a problem with an initial setup of a Windows Form Application for a Visual C++ Project. The Windows Form Application (.NET) template is not...
0
2504
by: forge | last post by:
Installing Merge Modules from C# Windows Form Application (not using a setup and deployment project) Hi, Currently, we have an InstallShield project that creates a setup.exe that only...
1
2185
by: Dean R. Henderson | last post by:
I have a Windows library that I bind into a Windows Form application and into an ASP.NET Web Application. I have a procedure in the library that executes a DTS Package. I have also used...
4
7057
by: bob lambert | last post by:
Help I am trying to deploy to another pc a vb.net std 2002 windows form application. I am confused. I created a project - windows form I built form, compiled and debugged. I created a...
3
2960
by: Henry Seymour | last post by:
I've developed a .Net Windows Form application and used the Click-Once Deployment. In that application I would like to allow the user a click-once method of uninstalling it. I do not find an...
1
2220
by: Dave | last post by:
Hello all, I have an application that is accessing files from a mapped drive. I have full access to the share that is mapped and from explorer can delete files as I need. My application needs to...
0
1267
by: querry | last post by:
Hi all, I am developing a Windows form Application in VC++.NET using the Visual Studio 2005 installed on Windows Server 2003. The UI part of the project is almost complete. I am now looking forward...
2
2591
by: ashkan0021 | last post by:
hi, i have a solution in C#.Net that includes 2 project and ASP.net & A Windows form application project, i want to open some pages of my asp.net project in my windows application, i'd be realy...
5
1985
sword117
by: sword117 | last post by:
im trying to use frames to create a video in the windows form application everything works if the first FOR is <10, if is > to 10 an error appears saying "FileNotFoundException was unhandled". i need...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5066
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.