Results 1 to 3 of 3

Thread: Drawing in VB.NET question

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    Seattle, WA USA
    Posts
    216

    Drawing in VB.NET question

    OK, the following code will take a BMP file and draw it to a main form dialog window. HOW do I make it draw to the dekstop background on my screen instead of onto the form dialog? Take out the "Inherits Form"?

    By the way, I DONT want to change the wallpaper, just draw over the current one. Is this possible? Kinda like an overlay.

    VB Code:
    1. Imports System
    2. Imports System.Windows.Forms
    3. Imports System.Drawing
    4. Public Module modmain
    5.    Sub Main()
    6.       'The KPD-Team 2001
    7.       'URL: [url]http://www.allapi.net/dotnet/[/url]
    8.       'E-Mail: [email][email protected][/email]
    9.       Dim theForm as MainForm = new MainForm()
    10.       theForm.ShowDialog()
    11.    End Sub
    12. End Module
    13. Public Class MainForm
    14. Inherits Form
    15.    Dim BackGround as new Bitmap("C:\Windows\Bubbles.bmp")
    16.    Protected Overrides Sub OnPaint(e as PaintEventArgs)
    17.       e.Graphics.DrawImage(BackGround, new Point(0, 0))
    18.    End Sub
    19. End Class

    -- Ethan --
    www.ethan-c-allen.com
    Last edited by ethanwa; Dec 15th, 2002 at 08:19 AM.
    VB6, VB.NET, C#, SQL, XML, ADO.NET, ASP.NET, HTML.
    MCP & A+ Certified. Looking for a job in the Seattle, WA area.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width