LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
inf inf is offline
external usenet poster
 
Posts: 1
Default VB.NET - Showing a form from a thread


I've got an excel plug-in in which I spin off a thread to do some work

Dim testThread As New System.Threading.Thread(AddressOf
testObject.testMethod)
testThread.Start()


That delegate method attempts to create and show a form:

Private Sub testMethod()
Dim testForm As New Form()
testForm.Size = New System.Drawing.Size(300, 300)
testForm.Text = "Test Form 1"
testForm.ShowInTaskbar = True
testForm.Show()
End Sub


This is pretty simple, and appears to work- the thread starts
correctly, and the delegate testMethod is called. However, when the
form is "shown", in Excel it briefly blinks onto the screen then
dissapears. It doesn't show up on the taskbar, ether.

I have tried the Enabled and Visible properties, and the Focus() and
Activate() methods of the System.Windows.Forms.Form testForm object,
but none seem to change this behavior.

Does anyone have any ideas for why this would act this way?


--
inf
------------------------------------------------------------------------
inf's Profile: http://www.excelforum.com/member.php...o&userid=37676
View this thread: http://www.excelforum.com/showthread...hreadid=572844

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing form Tim Kredlo Excel Programming 2 October 6th 05 05:15 PM
How do I set up a standard form showing incentive calculations KeithB Excel Discussion (Misc queries) 2 May 30th 05 09:41 AM
background color showing only when in email form David Excel Discussion (Misc queries) 1 January 23rd 05 09:46 PM
Run time Error -2147352571 when showing a form Ric Payne Excel Programming 2 October 2nd 03 04:48 AM
How to set focus back to sheet after showing a user form Les[_4_] Excel Programming 0 July 21st 03 07:58 PM


All times are GMT +1. The time now is 08:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"