GDI

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi, I have the routine below where I wish to render a pie chart on a button. The routine works if I use the commented out code but I recently discovered a shorter way to do it (just the single line at the bottom of the routine). Only problem is the pie chart doesn't appear at all when I try the short method. I don't get any errors, it just doesn't appear. Any thoughts?

Private Sub piechart()
'Dim dg As Graphics
Dim sb = New SolidBrush(Color.Blue)

'me.button1.Image = New Bitmap(me.button1.Width, me.button1.Height)
'dg = Graphics.FromImage(me.button1.Image)
'dg.FillPie(sb, 0, 0, 50, 50, 0, 90)
me.button1.CreateGraphics.FillPie(sb, 0, 0, 50, 50, 0, 90)
End Sub
--
______ ___ __
/_ __/_ __/ _ )_______ ___ _/ /_____ ____
/ / / // / _ / __/ -_) _ `/ '_/ -_) __/
/_/ \_, /____/_/ \__/\_,_/_/\_\\__/_/
/___/

There are 10 types of people in this world; those who understand the binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.
.



Relevant Pages

  • Re: AddPicture in VBA without explict reference to a file path?
    ... Private Sub SetLinkedImagesLocalPath() ... ' This routine sets the new path for external links. ... Dim oRange As Word.Range ... Dim oField As Word.Field ...
    (microsoft.public.word.drawing.graphics)
  • RE: Routine running slow (memory leak?)
    ... In the first sub, ListAuditResults, I set up the 3 past ranges using the Set ... of no memory leak) as I need them all the time until the routine ends. ... it would never run again and I could put "Set Hardrng = Nothing" ... Dim PasteStartCell As String ...
    (microsoft.public.excel.programming)
  • Re: StoryRanges, finding headers/footers
    ... Public Sub BatchReplaceAnywhere() ... Dim FirstLoop As Boolean ... 'This routine supplied by Peter Hewett ...
    (microsoft.public.word.vba.general)
  • Re: file delete routine is intermittent
    ... If I open the recycle bin and restore all, close and restart the application and run it again it ... Click the command button to run the routine a second time and then those left behind items are sent ... > Dim WFD As WIN32_FIND_DATA ... > Dim hFile As Long ...
    (microsoft.public.vb.winapi)
  • RE: Macro doesnt run on new machine
    ... Hi Jamie, your routine was a bit of a puzzle to me, but I was able to ... purposely referenced the wrong path that stores the EIS requests Spreadsheet ... >>> Dim olApp As Outlook.Application ...
    (microsoft.public.excel.programming)