Results 1 to 14 of 14

Thread: Can I draw to a PictBox outside of a paint event?

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2024
    Posts
    18

    Can I draw to a PictBox outside of a paint event?

    Guys,

    I finally realized pros/cons of CreateGraphics Method vs. Paint event (with some help from members here) for a Picture box.

    I want program code that is doing calculations to to update several different PictureBoxes but it seems weird to have calculation code have to be inside a Paint event to paint the "data"...

    Structurally I am asking if I can have a program that calculates something and then updates multiple different Pictureboxes (mostly just drawing points or showing displaying data in a plot format)...

    Is there a method to call DrawRectangle() function from code running OUTSIDE of the PaintEvent and update a drawing in a specific PictureBox by passing the right parameters?

    Ideally I would have the main program running its calcs and when it gets a result to be displayed I can draw to pictBox a, b, c and so forth form the main program event (not from a Paint Event for each Picture Box).

    Right now the program runs the specific code within the Paint event itself...this becomes problematic when I do different calculations and want to print them to different PictureBoxes.
    Seems like I need to split up the calculations so that each calculation occurs in a different PictureBox Paint event...

    Appreciate any hints as to how to do this, assuming it is possible.
    Last edited by Swisskid; Oct 29th, 2024 at 06:06 PM. Reason: Clarity

Tags for this Thread

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