need help from Nikolay on his addin (or someone else who is smarter than me)

Started by perry59, November 02, 2022, 06:49:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nikolay

Just as an idea - maybe there is some OTHER panel opened, and this one (the one from the add-in) is docked on the top of that one?
And the second one forces the width of the whole sidebar somehow. Could you try to dock the add-in panel to the left side instead (i.e. drag it by the header and just dock to the left)?

perry59

I tried that too. My shapes panel is usually docked on the left, so I "floated" it out into drawing area and drug the addin panel over to the left and docked it there. But, when I use the toggle-panel button to close and then re-open it, it goes back to the right hand side where it is made too small to see. That part is hard coded in the addin. My other forms though remember their size and position because I record that info in "My.Settings". I think I'll try to put the addin panels position there too so it will start from it's last position as well.
I'd still like to know what the heck is going on though and why it's only this computer (so far), I don't want my potential users to get befuddled with this.
Thanks for your help Nikolay!!

by the way, here is the code in my typical form load to position the form:
(maybe put into the "createwindow" function)

If (ModifierKeys And Keys.Shift) = 0 Then
            Dim initLocation As String = My.Settings.[Default].AddWires //<-"addwires" is form name
            Dim il As New Point(0, 0)
            Dim sz As Size = Size
            If Not String.IsNullOrWhiteSpace(initLocation) Then
                Dim parts As String() = initLocation.Split(","c)
                If parts.Length >= 2 Then
                    il = New Point(Integer.Parse(parts(0)), Integer.Parse(parts(1)))
                End If
                If parts.Length >= 4 Then
                    sz = New Size(Integer.Parse(parts(2)), Integer.Parse(parts(3)))
                End If
            End If
            Size = sz
            Me.Location = il
        End If


and here is the code in my typical form close which records the last size/position:
(maybe put into the "destroywindow" function)

If (ModifierKeys And Keys.Shift) = 0 Then
            Dim location__1 As Point = Location
            Dim size__2 As Size = Size
            If WindowState <> FormWindowState.Normal Then
                location__1 = RestoreBounds.Location
                size__2 = RestoreBounds.Size
            End If
            Dim initLocation As String = String.Join(",", location__1.X, location__1.Y, size__2.Width, size__2.Height)
            My.Settings.[Default].AddWires = initLocation  //<-"addwires" is form name
            My.Settings.[Default].Save()
        End If
what, me worry?

perry59

I believe I found the main culprit.
I have a dual monitor system at work. The visio application was opening on the secondary monitor. When I moved it to the primary monitor then the panel worked as expected. Still weird, it should not matter what monitor it is displayed on.
As a side note, I tried modifying the panelFrame functions in the addin so that the panel frame could be moved around and remember it's position. Only partially successful, the necessary code is a bit past my skill level right now.
Thanks for all your help Nikolay!
what, me worry?