Depending on where I add an 'Apply Changes" button on a UserControl form, it is sometimes not visible. (BTW: the button forces control to an addhandler to serialize data and control switch setting). It seems that if the button is added to the lower left or lower right corner of the form, it is visible, but if added to the top, the UserControl seems to mangle the button(?)
Also, there is some interesting behavior if placement of the UserControl is above the added button, and this behavior acts like a button click. Thus, there seems to be volatility if a button added to a UserControl Form is anywhere near the UserControl.
Below is the code I am using:
Dim myform As New Form myuc.autosize = True 'Note myuc is the actual usercontrol, instantiated as an object from usercontrol resources myform.AutoSize = True myform.Dock = DockStyle.Fill myform.Controls.Add(myuc) myform.Show() myform.Width = 0 myform.Height = 0 myform.Width = myuc.width myform.Height = myuc.height + 50 myform.Left = 0 myform.Top = 0 Dim btn As New Button btn.Text = "Apply" btn.Top = myform.Bottom - 50 btn.Left = myform.Right - 60 btn.BringToFront() myform.Controls.Add(btn)