473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

invisible gui

I have a program that process files on a hard drive. Everything works fine,
it shows a progress bar as it processes the file. The problem occurs when I
have the program look for files to process on startup. The gui is invisible
untill it processes the files it finds as it startsup. After which it
appears and everything works normally when the next file needs to be
processed.

Is there anyway to tell the program to not look for files untill the
interface is visible? I need a method like onGUIAppears.
Thanks in advance.
Jun 27 '08 #1
5 1483
On Thu, 15 May 2008 18:01:25 -0700, Dave <DW**@newsgroup.nospamwrote:
I have a program that process files on a hard drive. Everything works
fine,
it shows a progress bar as it processes the file. The problem occurs
when I
have the program look for files to process on startup. The gui is
invisible
untill it processes the files it finds as it startsup. After which it
appears and everything works normally when the next file needs to be
processed.

Is there anyway to tell the program to not look for files untill the
interface is visible? I need a method like onGUIAppears.
It's difficult for me to understand how your GUI can show progress if the
processing begins after the GUI is shown, but not before. Perhaps you've
made a mistake in your initialization by starting the processing before
some specific initialization within the GUI is done. The question of
visibility shouldn't matter.

That said, you can override OnShown() in your form class to know when the
form is actually being shown and delay your processing until that point.

Pete
Jun 27 '08 #2
You misunderstood, I mentioned the progress bar as a reason to why I wanted
to see the form before processing begins. You CAN NOT see the progress bar
on startup.The files are processed correctly even though you can't see the
progress.

I beleive the OnShown() will do what I need. Can you post a short example on
how to use this?

Thanks,

Dave.

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Thu, 15 May 2008 18:01:25 -0700, Dave <DW**@newsgroup.nospamwrote:
>I have a program that process files on a hard drive. Everything works
fine,
it shows a progress bar as it processes the file. The problem occurs
when I
have the program look for files to process on startup. The gui is
invisible
untill it processes the files it finds as it startsup. After which it
appears and everything works normally when the next file needs to be
processed.

Is there anyway to tell the program to not look for files untill the
interface is visible? I need a method like onGUIAppears.

It's difficult for me to understand how your GUI can show progress if the
processing begins after the GUI is shown, but not before. Perhaps you've
made a mistake in your initialization by starting the processing before
some specific initialization within the GUI is done. The question of
visibility shouldn't matter.

That said, you can override OnShown() in your form class to know when the
form is actually being shown and delay your processing until that point.

Pete

Jun 27 '08 #3
On Thu, 15 May 2008 22:14:31 -0400, "Dave" <DW**@newsgroup.nospam>
wrote:
>You misunderstood, I mentioned the progress bar as a reason to why I wanted
to see the form before processing begins. You CAN NOT see the progress bar
on startup.The files are processed correctly even though you can't see the
progress.

I beleive the OnShown() will do what I need. Can you post a short example on
how to use this?

Thanks,

Dave.
Something like this should do:

using System;
using System.Windows.Forms;

class Class1 : Form
{
bool firsttime = true;
protected override void OnShown(EventArgs e)
{
if (firsttime)
{
firsttime = false;
// ##put your code here##
MessageBox.Show("I've been shown! (for the first time)");
}
base.OnShown(e);
}
static void Main(string[] args)
{
Application.Run(new Class1());
}
}

If you need more help, you'll need to post some code. Please follow
this guidelines:

http://www.yoda.arachsys.com/csharp/complete.html

Mach
Jun 27 '08 #4
Hi Dave,

When a Form is loaded, it's Load event is fired first. The Form won't show
until all lines of code in its Load event handler finish executing. After
that, the Form's Activated event is fired and then the Shown event.

If the Form does some time-consuming work in the Activated or Shown event
handler, the UI of the Form will be blocked, i.e. all controls on the Form
are not painted properly or not responsive. This is because the main UI
thread is busy and doesn't have a chance to paint/refresh the UI of the
Form.

To show a Form and then do some time-consuming work without blocking the
UI, I suggest that you do the time-consuming work in a separate thread. You
can create a Thread instance or call the BeginInvoke method on the delegate
to the time-consuming method to do it, if you're using .NET 1.x.

If you're using .NET 2.0, I recommend you use the BackgroundWorker
component, which provides a concise multiple-threads programming model and
is very easy to use. You can start a BackgroundWorker in the Form's Load
event handler in your practice.

For more information on how to use the BackgroundWorker component, please
refer to the following MSDN document:
http://msdn.microsoft.com/en-us/libr...backgroundwork
er.aspx

Hope this helps.
If you have anything unclear, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 27 '08 #5
Hi Dave,

How about the problem now?

If the problem is still not solved, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matt | last post by:
Are there any settings to make a page invisible to the user until certain time? For example, I want mypage.html is invisible to the user until 12:00am. But mypage.html is already in the IIS server....
10
by: Cy | last post by:
I've had good luck with posting in the past, so we'll see how things go this time...:) I have an Access 2000 form. On the form is about 40 objects. I want to set everything to invisible,...
3
by: Jose_Csharp | last post by:
Hi guys, I´m trying to make a startup invisible form. I don´t want a form with Opacity property 0. First I did the property Visible of the form to false. It wasn´t a good idea, was too easy. Then...
3
by: Richard | last post by:
After printing a userlist to a Datagrid i want some names not to be shown. I want to know how i can make a entire datagrid row invisible. I suspect its something with the OnItemDatabound but i am...
3
by: rockdale | last post by:
Hi, All: I have a datagrid with TemplateColumn as following: <asp:TemplateColumn Visible="False" > <ItemStyle Width="0px"></ItemStyle> <ItemTemplate> <asp:Label id="lblMin_Value"...
0
by: Fir5tSight | last post by:
Hi All, Again I apologize for posting this topic at the wrong forum, because I don't know where else I can get help on this matter. This is about invisible lines and rectangles in a PDF file....
7
by: Nader | last post by:
It's easy to make the last row in a datagrid (filled with a table) invisible: datagridObject.Rows.Visible = false BUT if 'i' is not the last row then things go wrong. I even tried: for...
9
by: Mel | last post by:
I have 10 columns total. 3 of them are invisible. The rest are read- only BoundFields, 3 of which are editable fields using TemplateFields. Upon editing, I want to validate what the user enters...
5
by: my.shabby.sheep | last post by:
Hi, I want to do the following. I want to make a table column invisible to the screen, but I still want to be able to get the innertext that would have been stored in the cell for certain...
5
by: Andy B | last post by:
I have 2 TextBoxes and an Add button on a page. When the user fills in the TextBoxes, the values are added to a dataset table. When the page gets done reloading, the TextBoxes are turned into...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.