I have the following which generates MDI forms, but doesn't show them at
this stage:
For n As Integer = 1 To 10
fmViewer(n) = New frmViewer
fmViewer(n).Tag = n
fmViewer(n).Mdi Parent = Frm1
Next
From within a new thread I wish to show a form:
fmViewer(4).sho w
However, it doesn't show. The answer I am sure is because I am trying to
show it from within a thread. How can I achieve this?
-Jerry 5 1219
is fmViewer an array? or are you trying to do something else....please
explain a little bit more
--
-iwdu15
Jerry Spence1 wrote:
I have the following which generates MDI forms, but doesn't show them at
this stage:
For n As Integer = 1 To 10
fmViewer(n) = New frmViewer
fmViewer(n).Tag = n
fmViewer(n).Mdi Parent = Frm1
Next
From within a new thread I wish to show a form:
fmViewer(4).sho w
However, it doesn't show. The answer I am sure is because I am trying to
show it from within a thread. How can I achieve this?
What is frmViewer? Here you are using it as both the name of your
class and the name of the array variable. Can you show us the
declaration for frmViewer?
Chris
Jerry,
All Form access must be done from the main UI thread. That includes
creating, manipulating, and showing the Form. You'll need a reference
to an existing Form or Control that your worker thread will use to
marshal the execution of a delegate onto the UI thread by calling
Invoke or BeginInvoke. That delegate should contain the code to create
and show the new Form. Invoke and BeginInvoke are among the very few
members of a Form or Control that are actually thread-safe.
Brian
Jerry Spence1 wrote:
I have the following which generates MDI forms, but doesn't show them at
this stage:
For n As Integer = 1 To 10
fmViewer(n) = New frmViewer
fmViewer(n).Tag = n
fmViewer(n).Mdi Parent = Frm1
Next
From within a new thread I wish to show a form:
fmViewer(4).sho w
However, it doesn't show. The answer I am sure is because I am trying to
show it from within a thread. How can I achieve this?
-Jerry
Hi Chris
fmViwer is the name of my form, fmViewer() is an array. I can see the
difference is rather small!
-Jerry
"Chris Dunaway" <du******@gmail .comwrote in message
news:11******** **************@ m79g2000cwm.goo glegroups.com.. .
Jerry Spence1 wrote:
>I have the following which generates MDI forms, but doesn't show them at this stage:
For n As Integer = 1 To 10
fmViewer(n) = New frmViewer
fmViewer(n).Ta g = n
fmViewer(n).Md iParent = Frm1
Next
From within a new thread I wish to show a form:
fmViewer(4).sh ow
However, it doesn't show. The answer I am sure is because I am trying to show it from within a thread. How can I achieve this?
What is frmViewer? Here you are using it as both the name of your
class and the name of the array variable. Can you show us the
declaration for frmViewer?
Chris
"Brian Gideon" <br*********@ya hoo.comwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
Jerry,
All Form access must be done from the main UI thread. That includes
creating, manipulating, and showing the Form. You'll need a reference
to an existing Form or Control that your worker thread will use to
marshal the execution of a delegate onto the UI thread by calling
Invoke or BeginInvoke. That delegate should contain the code to create
and show the new Form. Invoke and BeginInvoke are among the very few
members of a Form or Control that are actually thread-safe.
Brian
Jerry Spence1 wrote:
>I have the following which generates MDI forms, but doesn't show them at this stage:
For n As Integer = 1 To 10
fmViewer(n) = New frmViewer
fmViewer(n).Ta g = n
fmViewer(n).Md iParent = Frm1
Next
From within a new thread I wish to show a form:
fmViewer(4).sh ow
However, it doesn't show. The answer I am sure is because I am trying to show it from within a thread. How can I achieve this?
-Jerry
Thanks Brian. I'll have a look at Invoke and BeginInvoke.
-Jerry This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Krzysztof Karnicki |
last post by:
I would like develop Form on my Windows Application, that is going to notify
the user, just like Microsoft Office 2003 shows that there are new mail
coming. When I use System.Windows.Forms.Form and show it on a different then
main thread on my application, this new form became focused, but I want that
new form at the beginning acts like just stay-on-top notification… also in
this form I would like have controls, that could be focused,...
|
by: Sharon |
last post by:
I have a Form class that can be open by parent Form or by .NET Remoting
command.
When the parent Form opens the Form - All fine !
But when the .NET Remoting command is trying to Show the Form, the Form
stuck !! I tried to change the Remoting delegate invocation to asynchronous
and to synchronous, yet both cause the same Form Show() to stuck.
When I mean stuck, I mean the the Form is shown but non of it controls are
shown, only gray window...
|
by: Raed Sawalha |
last post by:
I have form with progress bar ,when application begin processing and progress
bar moving if I minimized the form and try to restore it ,it is not showing
until the processing completed ,how can I enabled minimize, maximize moving
form while processing in underway?
|
by: BergRD |
last post by:
For some odd reason my original post was double posted then removed
from the forums. Odd happenings but wanted to re-post incase no one
saw the original, thanks :D
> Salutations!
>
> New to the forums but have gotten many an idea from lurking over the
past few months but alas it's time to begin positing; posting to a
problem I cannot seem to resolve. This is a long description but my
hopes are the more information the better someone...
|
by: EnglishMan69 |
last post by:
Hello All,
I am using VB2005 Beta 2 in VS 2005 and am running into a small
problem. I need to be able to add a picture box to the main form from
within a thread.
The program goes to a web site, performs a search based on POST
variables, retrieves the code, parses the information (including a url
for a thumbnail image) and displays the results.
I am using threads, since the program will appear to freeze while
| |
by: Miro |
last post by:
I will try my best to ask this question correctly. I think in the end the
code will make more sence of what I am trying to accomplish. I am just not
sure of what to search for on the net.
I have a form that has a button. ( this form is a child form of a parent
form ( main form ).
Anway...in this child form I have a button, and if clicked a bunch of code
will get executed.
I would like to show a Progress Bar / form in modal/ShowDialog...
|
by: Lars Netzel |
last post by:
Hi
I have a Form that on Form_Load() does some heavy database reading and I
want to show that as a progressbar ontop of the main window..
I want to create a smaller Form with a progressbar.. and then in the main
form, start a new thread that opens that small form and for each progress
the heavy operation send a new value to the small form thru an event.
I have managed to run a function or a sub in another thread but I can't
|
by: Claire |
last post by:
Hi
I need to set my main form as the owner of an error dialog box shown when
there's an exception in a background thread. This is to make sure that the
error form is closed down if the user pulls their security card while the
error window is being shown.
In visual studio 2003, my main form set a static "owner" variable within my
frmWarning class definition and if the error form was needed (and null owner
passed) then this static variable...
|
by: =?Utf-8?B?TWF0dA==?= |
last post by:
Hi
I have an app that runs without a main form, just a notification icon, when
the user clicks the icon the form is shown, and when the form is minimized
it's hidden.
This all works great, and I have implemented single instance so that when
another instance is run, an event gets signalled in the 1st instance, and
what I would like to do is to show the form. I can do this using Form.Invoke
to show the form in most cases, however at...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |