|
-
June 13th, 2009, 01:20 AM
#2
Re: Simultaneous PowerPoints on a vb form
Okay, this seems to be the problem of VB's single threading apartment model in that you say as long as the form has focus it works and I need to change the focus to the other form for it to transition. It also looks like from your example that the calls to transition are blocking or synchronous and if this is so then, I don't know what to tell you beyond the CreateThread API.
BUT, there might be a solution using the timer control...
To use example start new standard exe project>add command button>add timer control>paste code>run>click button
Code:
Option Explicit
Dim MyCounter As Integer
Private Sub Form_Load()
Me.AutoRedraw = True
Me.FontSize = 20
Me.FontBold = True
End Sub
Private Sub Command1_Click()
Dim NF As Form
Me.Left = (Screen.Width / 2) - (Me.Width / 2)
Me.Top = (Screen.Height / 2) - (Me.Height / 2)
Set NF = New Form1
Load NF
NF.Left = 0
NF.Top = 0
NF.Timer1.Interval = 250
NF.Timer1.Enabled = True
NF.Show
Set NF = New Form1
Load NF
NF.Left = Screen.Width - Me.Width
NF.Top = 0
NF.Timer1.Interval = 250
NF.Timer1.Enabled = True
NF.Show
Set NF = New Form1
Load NF
NF.Left = 0
NF.Top = Screen.Height - Me.Height
NF.Timer1.Interval = 250
NF.Timer1.Enabled = True
NF.Show
Set NF = New Form1
Load NF
NF.Left = Screen.Width - Me.Width
NF.Top = Screen.Height - Me.Height
NF.Timer1.Interval = 250
NF.Timer1.Enabled = True
NF.Show
End Sub
Private Sub Timer1_Timer()
Me.Cls
Print MyCounter
MyCounter = MyCounter + 1
If MyCounter > 1000 Then MyCounter = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim F As Form
For Each F In Forms
Unload F
Next
End Sub
Just a couple of thoughts...
Good Luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|