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. .NET (Core and Framework)
  4. Popup Panel on custom control does not appear - any ideas?

Popup Panel on custom control does not appear - any ideas?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharphelpquestion
2 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.
  • N Offline
    N Offline
    nzmike
    wrote on last edited by
    #1

    I have a VB.Net 2.0 custom control which allows me to pick a date and a 24 hour time. The control consists of a standard DateTimePicker to select the date and for the 24 hour time a textbox (txtHours) to display the selected hour, a label (lblSelectHours) which consists of an image of the standard dropdown icon and a Panel object. When the user clicks on the dropdown label the Panel, containing one button for each of the 24 hours in a day, should pop up. However, the panel is nowhere to be seen even though I know the label's Click event is firing. I am pretty puzzled about this as the popup panel for the standard DateTimePicker in the control appears perfectly. The Panel object is defined in the control as being off the main area being displayed but when the user clicks the dropdown arrow (the label) the event handler below should set the correct position to appear and set Visible to true: Private Sub lblSelectHours_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblSelectHours.Click pnlHours.Left = Me.Left + txtHours.Left pnlHours.Top = Me.Top + txtHours.Top + txtHours.Height pnlHours.Visible = True pnlHours.BringToFront() End Sub So does anyone know why my popup panel won't appear? If I copy the various components of the control and just put them on a form (ie: without the use of a custom control) the panel appears fine with this same code. TIA for any help... Mike

    L 1 Reply Last reply
    0
    • N nzmike

      I have a VB.Net 2.0 custom control which allows me to pick a date and a 24 hour time. The control consists of a standard DateTimePicker to select the date and for the 24 hour time a textbox (txtHours) to display the selected hour, a label (lblSelectHours) which consists of an image of the standard dropdown icon and a Panel object. When the user clicks on the dropdown label the Panel, containing one button for each of the 24 hours in a day, should pop up. However, the panel is nowhere to be seen even though I know the label's Click event is firing. I am pretty puzzled about this as the popup panel for the standard DateTimePicker in the control appears perfectly. The Panel object is defined in the control as being off the main area being displayed but when the user clicks the dropdown arrow (the label) the event handler below should set the correct position to appear and set Visible to true: Private Sub lblSelectHours_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblSelectHours.Click pnlHours.Left = Me.Left + txtHours.Left pnlHours.Top = Me.Top + txtHours.Top + txtHours.Height pnlHours.Visible = True pnlHours.BringToFront() End Sub So does anyone know why my popup panel won't appear? If I copy the various components of the control and just put them on a form (ie: without the use of a custom control) the panel appears fine with this same code. TIA for any help... Mike

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      I am surprised to see Left+Left and Top+Top maybe your coordinates are way off ? :)

      Luc Pattyn

      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