Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to call

Below is the code:

VB
Private Sub VideoPaint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles picOriginal.Paint

    Dim g As Graphics = e.Graphics
    Dim recta As Rectangle = New Rectangle(Xx(1), yy(1), hh(1), www(0))
    Dim pen As Pen = New Pen(Color.FromArgb(128, 32, 100, 200), 1)
    Dim b As Brush = New SolidBrush(pen.Color)

    g.FillRectangle(b, recta)


End Sub


on this code event

VB
Private Sub picOriginal_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles picOriginal.MouseUp
  
CALL PAINT EVENT?

 Catch ex As Exception
            Exit Sub

        End Try
En sub
Posted
Updated 27-Oct-15 14:53pm
v3
Comments
Sergey Alexandrovich Kryukov 28-Oct-15 2:17am    
There is no such concept, "call events". The question does not really make sense. Perhaps you should explain your ultimate goal, to get some advice, explain what you want to achieve. In the meanwhile, learn delegates and events; right now, you don't have a clue. Not to worry, you can learn it.
—SA
Sergey Alexandrovich Kryukov 28-Oct-15 2:27am    
And please, would you stop posting your "answers"? I looked through some; they are fake. You are answering to yourself, often after other members really answer you. And you even self-accept your "answers"? Who ever need them? You can just collect down-voted and abuse reports which can, in case of heavy abuse, lead to cancellation of your account.
—SA
NekoNao 3-Nov-15 22:34pm    
I marked mine as "answers" because I solved my own problem when no one even gave me the right answer. it that even a problem? I think it would help others that would encounter such problems.

Try


Quote:
Calling this.Invalidate() will cause the Paint event to fire.



Thank You
 
Share this answer
 
That is not the way to do it. You need to tell the form to redraw itself with a call to Refresh[^]. The actual code to do the drawing should be inside an override of the OnPaint method[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900