Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - DockingPaneManager_Action
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DockingPaneManager_Action

 Post Reply Post Reply
Author
Message
tomamoss View Drop Down
Newbie
Newbie


Joined: 19 December 2006
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote tomamoss Quote  Post ReplyReply Direct Link To This Post Topic: DockingPaneManager_Action
    Posted: 12 January 2007 at 5:08am

Hi

 

If I put a picturebox into a pane ie Item.Handle = Picture1.hwnd

in the event DockingPaneManager_AttachPane

 

Then add a form into another pane, which has a public sub procedure that displays a msgbox.

 

If you call that procedure from DockingPaneManager_Action while moving focus from the form to the pane with picture box the app will crash.

 

my question is do you have to treat picture boxes different than form?

and if so what do you need to do?
 
Thanks  for your help
 
Tom
Back to Top
tomamoss View Drop Down
Newbie
Newbie


Joined: 19 December 2006
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote tomamoss Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2007 at 6:14am

Sorry to be a pain

 

But in my desperate attempt to get a fix I took the SDISample sample and

just added a sub

 

Public Sub msg()

   MsgBox "test"

End Sub

in the form frmPane

 

in the DockingPaneManager_Action event I use this

 

If Action = PaneActionDeactivated Then

        If Pane.Title = "Pane 7" Then

            arrPanes(6).msg

        End If

 End If

 

Once this is called the msgbox will show, and once you click OK it will crash.

 

I really could do with some help with this

 

Cheers

 

Tom
Back to Top
LittleJK View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 April 2006
Status: Offline
Points: 168
Post Options Post Options   Thanks (0) Thanks(0)   Quote LittleJK Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2007 at 2:50pm
most of your issue lies with that you are trying to use a form. When attaching the form you should be declaring


Private WithEvents fnewform As newform

and then attach fnewform.hwnd either in the attach pane method or if you want to you can use a shortcut of declaring it in the code for the docking pane itself such as:

With Me.DockingPaneManager
       

        .CreatePane ID_PANE, 241, Int(Me.Height / 15), DockLeftOf
        With .FindPane(ID_PANE)
            .Handle = Me.pic_options.HWnd or me.fnewform.hwnd
            .Options = PaneNoCloseable Or PaneNoDockable
            .Title = "Pane"
        End With


Also you are trying to pass it as a public sub... you don't need to do that at all with the form...  to display a message from the form... you can put a msgbox in the mouse click event of whatever is in the form
Back to Top
tomamoss View Drop Down
Newbie
Newbie


Joined: 19 December 2006
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote tomamoss Quote  Post ReplyReply Direct Link To This Post Posted: 13 January 2007 at 9:00am

Thank you littleJK

 

All my problems started because I want to verify that a user has filled in all fields on a form.

I could check this when the form loses focus.

But the form lost focus event does not work with the DockingPane.

So I use the Deactivate event. But I can't set the focus back to the form.

 

Code example.

Add two picturebox to form named frmMain.

Add another form. Form2

 

Add the following code to frmMain

 

Option Explicit

 

Private WithEvents frmForm2 As Form

 

Private Sub Form_Load()

Set PanePic1 = DockingPaneManager.CreatePane(1, 1350, 1200, DockTopOf)

PanePic1.Title = "Pic1"

 

Set PanePic2 = DockingPaneManager.CreatePane(1, 1350, 1200, DockTopOf)

PanePic2.Title = "Pic2"

PanePic2.AttachTo PanePic1

 

Set PaneForm2 = DockingPaneManager.CreatePane(1, 350, 700, DockBottomOf)

PaneForm2.Title = "Form2"

 

PanePic1.Handle = Picture1.hWnd

PanePic2.Handle = Picture2.hWnd

 

Set frmForm2 = New Form2

PaneForm2.Handle = frmForm2.hWnd

 

DockingPaneManager.VisualTheme = ThemeOffice2003

DockingPaneManager.TabPaintManager.Position = xtpTabPositionTop

DockingPaneManager.Options.HideClient = True

End Sub

 

Private Sub Form_Unload(Cancel As Integer)

Unload frmForm2

Set frmForm2 = Nothing

End Sub

 

Private Sub frmForm2_Deactivate()

'check that all fields are filled before they move the focus from this form.

MsgBox "Please fill all manditory fields on form."

frmForm2.SetFocus

End Sub

 

You will see that we are in a endless loop.

Thanks for all your help.

Cheers

Tom
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.111 seconds.