I've been using a set of code to make a form appear directly underneath a button. I know I'm either using the wrong one, or one that would be easier for what I'm trying to do. I currently have two sets of code. One for when the window is in default normal size, and the other for when it is maximized. This is the code as follows:
The issue I currently have is that when the user manually adjusts the form size, neither of the codes are relevant any longer, and the popup forms will no longer appear in their appropriate locations. I'm quite positive that the codes I have here are not the correct ones, and that the one that I'm looking for can actually set the forms to launch in their places in this case, a button (which is what these are supposed to be doing, though quite honestly, I think there's just simply something botched up with these codes, and their just sneakily hiding under my nose). This is probably a duh thing (it's been one of those days :lol:)
Code:
Dim formLocation = PointToScreen(TwitterButton.Location)
formLocation.Offset(798, 30)
TwitterPopupMenu.StartPosition = FormStartPosition.Manual
TwitterPopupMenu.Location = formLocation
TwitterPopupMenu.Show()
If Me.WindowState = FormWindowState.Maximized Then
formLocation.Offset(570, 2)
TwitterPopupMenu.StartPosition = FormStartPosition.Manual
TwitterPopupMenu.Location = formLocation
TwitterPopupMenu.Show()