Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. When i draw Rubberband selection on panel VisualBasic powerpack Shapecontrols are not displayed

When i draw Rubberband selection on panel VisualBasic powerpack Shapecontrols are not displayed

Scheduled Pinned Locked Moved Visual Basic
graphics
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dilipmca04
    wrote on last edited by
    #1

    this is the code i used to draw Rubberband selection on panel..when i draw rubberband selection it's hiding the Shape controls.. please give me the idea.. Thanks Public Class Form2 Dim Rect As Rectangle Private Sub Panel1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown Rect.Location = e.Location End Sub Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove If e.Button = MouseButtons.Left Then Rect.Size = New Size(e.X - Rect.X, e.Y - Rect.Y) Panel1.Invalidate() End Sub Private Sub Panel1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp Rect.X = -1 Rect.Y = -1 Rect.Width = -1 Rect.Height = -1 End Sub Private Sub Panel1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint Dim L, T, W, H As Integer L = Rect.X T = Rect.Y W = Rect.Width H = Rect.Height If W < 0 Then L += W : W = -W End If If H < 0 Then T += H : H = -H End If Dim p As New Pen(Color.Black) p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot e.Graphics.DrawRectangle(p, New Rectangle(L, T, W, H)) End Sub End Class

    H 1 Reply Last reply
    0
    • D dilipmca04

      this is the code i used to draw Rubberband selection on panel..when i draw rubberband selection it's hiding the Shape controls.. please give me the idea.. Thanks Public Class Form2 Dim Rect As Rectangle Private Sub Panel1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown Rect.Location = e.Location End Sub Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove If e.Button = MouseButtons.Left Then Rect.Size = New Size(e.X - Rect.X, e.Y - Rect.Y) Panel1.Invalidate() End Sub Private Sub Panel1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp Rect.X = -1 Rect.Y = -1 Rect.Width = -1 Rect.Height = -1 End Sub Private Sub Panel1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint Dim L, T, W, H As Integer L = Rect.X T = Rect.Y W = Rect.Width H = Rect.Height If W < 0 Then L += W : W = -W End If If H < 0 Then T += H : H = -H End If Dim p As New Pen(Color.Black) p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot e.Graphics.DrawRectangle(p, New Rectangle(L, T, W, H)) End Sub End Class

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      THe only thing I can think of that could cause this, is if the Shape Controls are not contained by your panel. It is possible for controls hosted by the form to appear on top of a panel, which is also hosted by the form. Are you sure that the shapes are on the panel?

      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

      D 1 Reply Last reply
      0
      • H Henry Minute

        THe only thing I can think of that could cause this, is if the Shape Controls are not contained by your panel. It is possible for controls hosted by the form to appear on top of a panel, which is also hosted by the form. Are you sure that the shapes are on the panel?

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        D Offline
        D Offline
        dilipmca04
        wrote on last edited by
        #3

        i placed after only i test it..it's not working..other you test it the whole code is there just u copy the code and take one panel and take shape controls test it.. Thanks

        H 1 Reply Last reply
        0
        • D dilipmca04

          i placed after only i test it..it's not working..other you test it the whole code is there just u copy the code and take one panel and take shape controls test it.. Thanks

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #4

          Please do a test for me, then let me know what happens. Run your application, then reasonably slowly, move the mouse pointer over your panel. Do not press any mouse buttons. just reasonable slowly move the mouse across the form. What happens?

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups