.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Setting the image as background for the form in widows form application

Posted By: Asha.MP     Posted Date: November 25, 2010    Points:2   Category :ASP.Net

I want to set an image as the background image for the form,
If i write the code in the page load, it is not working but if i write same thing in the button click event it will work.
What is the reason for this???
the code writen is

Dim b As Bitmap = New Bitmap("C:\Documents and Settings\scii062.DEVELOPMENT1\My Documents\My Pictures\h.jpeg")
Dim g As Graphics = Me.CreateGraphics
g.DrawImage(b, 1, 1, Me.Width, Me.Height)

Author: Jean Paul             
Posted Date: November 26, 2010     Points: 5   

After the load event, the form refresh is happening where the default painting will happen.

Instead of painting, you can use the property BackgroundImage of the form.

(mark as answer)

Jean Paul http://jeanpaulva.com/

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend