Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Popup Control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Popup Control

 Post Reply Post Reply
Author
Message
Maui View Drop Down
Groupie
Groupie


Joined: 10 June 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maui Quote  Post ReplyReply Direct Link To This Post Topic: Popup Control
    Posted: 16 December 2004 at 4:38pm

I have written an exe that does batch processing. It doesnt have a form, it just does the job and then reports the results in a msgbox.

I had a look at the Popup Control and thought it would make a nice replacement for the standard msgbox I was using.

My first request to the development team is Can you make this control creatable so that I can late bind it. eg dim PC as new PopupControl

Since you cant create it like this at the moment I had to add a form so that I could use this object.

This is what I did.

Private Sub ShowReport()
    Dim PC As XtremeSuiteControls.PopupControl
    Dim Item As PopupControlItem
   
    Load formAbout
   
    Set PC = formAbout.PopupControl
    PC.RemoveAllItems
    PC.Animation = xtpPopupAnimationSlide
    PC.AnimateDelay = 256
    PC.ShowDelay = 2000
    PC.Transparency = 255
    PC.VisualTheme = xtpPopupThemeOffice2003
   
    Set Item = PC.AddItem(50, 27, 200, 45, "TEST")
    Item.Bold = True
   
    PC.SetSize 270, 100
   
    PC.Show
End Sub

That worked fine except obviously formAbout is still loaded.

I cant unload the form in that Sub because unloading it also closes the PopupControl.

So I put this code in formAbout thinking it would unload the form when the popup control closed.

Private Sub PopupControl_StateChanged()
    If PopupControl.State = xtpPopupStateClosed Then
        Unload Me
    End If
End Sub

What actually happens is that my application crashes.

Any thoughts on how I could best achieve my goal? or why the IDE crashes when I unload the form?

 

 

 

 

Back to Top
Maui View Drop Down
Groupie
Groupie


Joined: 10 June 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote Maui Quote  Post ReplyReply Direct Link To This Post Posted: 29 December 2004 at 10:24am

For reference what I ended up doing to avoid the crashing was to create a form with nothing on it but a popup control and a timer and used the timer to unload the form when the state state changes.

You should investigate why it is that a timer can unload the form ok after checking the .state value but an Unload Me inside the state change event will crashe your application.

I had tried a loop (commented out in code below) but in the end went for the timer option.

Public Sub ShowReport()
    Dim Item As PopupControlItem
   
    Load formReport
      
    With formReport.PopupControl
        .RemoveAllItems
        .Animation = xtpPopupAnimationSlide
        .AnimateDelay = 256
        .ShowDelay = 2000
        .Transparency = 255
        .VisualTheme = xtpPopupThemeOffice2003
   
        Set Item = .AddItem(50, 27, 200, 45, "TEST")
        Item.Bold = True
   
        .SetSize 270, 100
       
        .Show
   
        'Do While .State <> xtpPopupStateClosed
        '        DoEvents
        'Loop
   
        'Unload formReport
    End With
End Sub

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.141 seconds.