Hello,

I have a situation in which I will be moving painted graphics around on a form. Is there a way to change the z-order of painted graphics like you do controls?

Just a sample..

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

VB Code:
  1. Dim g As Graphics = Me.CreateGraphics()
  2. Dim str As String = "135"
  3.  
  4. g.FillRectangle(Brushes.Black, 15, 5, 25, 17)
  5. g.DrawString(str, New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Point), Brushes.White, 15, 5)
  6.  
  7. g.Dispose()

How can I switch the DrawString and FillRectangle so that one happens before the other (other than just changing the code order of when they are drawn)?

Thanks!



End Sub