Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB.net Paint a Taskpane

Posted on 2012-04-08
2
Medium Priority
?
312 Views
Last Modified: 2012-04-09
Hi. I am trying to paint my TaskPane control. What is the best way to do this? In the code below I tried filling a Panel but how would I change the code to paint the actual TaskBar

    Private Sub TaskPaneControl_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim graphics As Graphics = Panel1.CreateGraphics()
        Dim rectBrush As New Rectangle(0, 0, 400, 200)
        Dim brush As LinearGradientBrush
        brush = New LinearGradientBrush(rectBrush, Color.FromArgb(46, 100, 160), _
                        Color.White, LinearGradientMode.Horizontal)
        graphics.FillRectangle(brush, rectBrush)
        graphics.Dispose()
    End Sub
1
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 37822172
Change:

    Dim graphics As Graphics = Panel1.CreateGraphics()

To:

    Dim graphics As Graphics = e.Graphics()

And get rid of the Dispose() call:

    ' graphics.Dispose() <-- get rid of this line
0
 

Author Closing Comment

by:Murray Brown
ID: 37822619
Thanks very much
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question