General Category > Support Questions

Dual monitors (PC)

<< < (2/3) > >>

Phrog30:
I forgot about disposing of the forms that I add to the panel.  I thought this would be easy but it takes several seconds to dispose of one form.  Here's what I'm using now:

--- Code: ---       
                Dim x As Form
                x = CallForm.GetFormByName(m_FormToOpen.Name)
                If x IsNot Nothing Then
                    _0000_Main_Parent.lbl_Display_Name.Text = x.Text
                    x.TopLevel = False
                    _0000_Main_Parent.pnlParent.Controls.Add(x)
                    x.Show()
                    x.BringToFront()
                    x.Focus()
                    'Remove all but this control (form), do last to prevent blinking
                    For i = 0 To _0000_Main_Parent.pnlParent.Controls.Count - 1
                        If i > 0 Then
                            Dim ctrlName = _0000_Main_Parent.pnlParent.Controls.Item(i).Name
                            _0000_Main_Parent.pnlParent.Controls.Item(ctrlName).Dispose()
                        End If
                    Next
                End If

--- End code ---

If I comment out the dispose, it's quick as quick could be, but once I let it dispose, it takes seconds to complete.  Any ideas and what is wrong and/or how I could do it different?

James

Phrog30:
I think I'm getting there, one thing I can't seem to get is form.owner.  I have reusable popups that when I display I set the owner.  I like the way this works.  But, on a dual monitor system if I want to open this popup from another display I want to display on the parent where the call button is.  I would have though simply changing the owner would work, but doesn't.  Is there a trick to changing the form owner?  Note, I don't close these popups, but hide them so they open faster next time, plus they open in the same spot they were closed.  Any tips on this is much appreciated.

James

Godra:
I am not sure if this is any related to what you are doing or asking about but check the idea Archie is using here:

http://advancedhmi.com/forum/index.php?PHPSESSID=b16bab674b77c83269a4a0c198469230&topic=1516.0

Phrog30:

--- Quote from: Godra on October 04, 2017, 08:56:18 PM ---I am not sure if this is any related to what you are doing or asking about but check the idea Archie is using here:

http://advancedhmi.com/forum/index.php?PHPSESSID=b16bab674b77c83269a4a0c198469230&topic=1516.0

--- End quote ---
Thanks, but that's not what I was looking for. I have since gotten things figured out to a point. I may post what I have when I get further along.

Phrog30:
Here's a link to an application that has multi-monitor support (up to 4):
https://drive.google.com/file/d/1FbSYQPQQAKJ13ZVo-Y7B8inKqjg3zXUj/view?usp=sharing

The forms display automatically if you have a multiple monitor setup.  If you only have 1, then it will only display one.  I use mdiparent.  Right now I have the initial forms hard coded.

James

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version