473,657 Members | 2,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Auto refresh splash screen

84 New Member
Hi Guys,
I have made an application which has a splash screen. This has one of the delegates to update a string which works fine.

My issue is that I want to automatically refresh this splash every 2 secs. I have tried with Timer & thread but havent been able to implement it properly [I have used threads and timer before but still]. The splash screen is pretty dumb with only to show text while the app works in the back ground. The splash object is created and just splashObj.Visib le = true; this allows me to continue with the current process.

Please help!
May 28 '08 #1
23 2218
jamesd0142
469 Contributor
Im not sure what version your using but,

form.refresh is an option in some versions of vb

example:
me.refresh
Or
textbox1.refres h
May 28 '08 #2
alag20
84 New Member
Im not sure what version your using but,

form.refresh is an option in some versions of vb

example:
me.refresh
Or
textbox1.refres h
Sorry I forgot. I am using c# - .Net 2. I know you can do this.Refresh() which works fine in most cases but if I start a timer and on timer tick, if i do this.Refresh() then this doesnt work!
May 28 '08 #3
Plater
7,872 Recognized Expert Expert
you have to make sure you are refreshing the correct object(s). "me" or "this" might not be refering to the correct object in all cases.

And it's .Update() that you should be using to force a redrew of a control. It's available on all controls I believe.
May 28 '08 #4
jamesd0142
469 Contributor
you have to make sure you are refreshing the correct object(s). "me" or "this" might not be refering to the correct object in all cases.

And it's .Update() that you should be using to force a redrew of a control. It's available on all controls I believe.

Is this the case in vb also?
Whats the difference between refresh and update?

James
May 29 '08 #5
Plater
7,872 Recognized Expert Expert
Hmm, now I'm not sure.
Refresh says it invalidates then redraws
Update says it redraws the already invalid region

I think refresh just takes more time because it has to do multiple windows messages (or at least more then update should take)
May 29 '08 #6
alag20
84 New Member
Here is the sample code I use. As you can see I am using Timer and hopefully on every tick it should refresh [I am using refresh coz I need it to invalidate the whole screen and redraw it]

I am calling it as below:
SplashScreen test = new SplashScreen();


and then whenever I need to display it test.Visible = true / false;


I hope this explains my issue!

[HTML]
.......
using Timer = System.Windows. Forms.Timer;

public partial class SplashScreen : Form
{

Timer myTimer = new Timer();

public Splash()
{
InitializeCompo nent();
}

private void Splash_Load(obj ect sender, EventArgs e)
{
myTimer.Interva l = 1000;
myTimer.Tick += new EventHandler(my Timer_Tick);
myTimer.Start() ;
}

void myTimer_Tick(ob ject sender, EventArgs e)
{
if (this.Visible) this.Refresh();
}}
}[/HTML]
May 29 '08 #7
Plater
7,872 Recognized Expert Expert
Assuming that .Start() is a valid function on timer (never used it) that all looks right.
Once every second the form should update. But you say it's not?

I do something rather similar. I have a form that performs an in-depth search on things. So I popup a little window that says "Searching. .." in big letters then below it I give a more detailed message "Searching item 124 / 409876" and it gets incrementend on each change of the number. The numbers move very fast, but they do appear to be updating correctly.

EDIT: I should point out that a timer_tick relies entirely on the sending of a windows message. If that thread is busy, the message will never get through.
If you are doing something in a loop, try throwing in an Application.DoE vents()
May 29 '08 #8
alag20
84 New Member
Well I have something similar in my app. But my only issue is sometimes when there is a big file to copy then this screen seems like hanged / crashed!


I cant even send Application.DoE vents during big file copy as suggested by you but I am also thinking that this could be the issue!

Any other idea's?

Ps : Timer is a thread, and you can start any Thread by thread.Start() - It works on its own!
May 29 '08 #9
Plater
7,872 Recognized Expert Expert
System.Threadin g.Timer is a thread
System.Windows. Forms.Timer is NOT a thread.

.Start() is available on both, for the Forms.Timer that you are using, it's the same as saying .Enabled=true
May 29 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
6916
by: Bill | last post by:
Problem 1) Any ideas on how I would get a splash screen to appear for a certain amount of time when I open a database - it's to display a text based disclaimer message. I know about message boxes in VB but I don't my users having to click on an OK buttone each time this appears. Problem 2)
3
2256
by: andrewcw | last post by:
I implemented the simplest of splash screens ( static and on its own thread ). But it seem that when first called maybe 8 seconds elapsed before it showed up, the main form follows several seconds later. Naturally recalling the application, the response is adequate I have 10 classes in my project. Some small, none really huge. And another form public class frmQCLoader : System.Windows.Forms.For { private System.Windows.Forms.DataGrid...
14
6686
by: SStory | last post by:
I am trying to make a splash screen for my vb.net app. It is an mdi app. including the splash code produces wierd results. not inluding makes things fine. Also have tried loading the splash form from: * load event of main mdi parent
2
2102
by: Joe Cool | last post by:
Using VB in VS2005. 2005 has a new way to implment a spash screen that alleviates the need for hardly any code. But I have found that when a GUI that has a splash screen is run as a scheduled task, the splash screen (and no other screen) is displayed for the entire run of the application. How can I disable the spalsh screen just for when an app is run as a scheduled task?
1
2252
by: Ken Allen | last post by:
I am developing a small utility program that must perform a considerable amount of 'background' or 'research' work before it can display any user interface. In general it can take 3-15 seconds to perform all of the work requured before we display any user interface. So we have determined that the utility should have a splash screen to assure the user that the program is executing and will provide results shortly. I should also note that...
5
6398
by: steve | last post by:
Hi All I have a form set as the splash screen in VB.net 2005 application properties How can I tell when it has or is closing, as I want to then run some licence checking code without the splash screen interfering with msgboxes which may need to be displayed if the licence is invalid or missing I have tried in the splash form's formclosing event but it does not fire
2
4212
by: will_456 | last post by:
In vb2005 Express: In My Project Application Splash Screen I have selected my splash screen form. The form opens on project startup but closes immediately before anyone would have time to read it. I presume it only stays visible while the main form initialises. This is not long enough but I can't see how to slow it down. Should I set the splash screen using the Application settings or go back to
10
22363
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= | last post by:
Hi In my app I have a SplashScreen, a login form and a main form. On launching the app, I'd like to show the SplashScreen while reading config files and attempting a database connection. I show progress of these tasks on a label on the SplashScreen form. Once this is completed ok, the splash screen should close and the login form should be displayed. A successful login closes that form and shows the main form.
4
5211
by: Gaz | last post by:
I am having a bit of a problem getting my application to work properly. RIght here is my problem... WHen my C# windows app loads up the start form, i create a new thread and show the splash on the new thread and put the main thread to sleep until the splash screen has done the business, then i kill the new thread and start another to show the login and again put the main one to sleep. Problem i have is that my splash screen will show...
0
8316
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,...
0
8833
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, 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...
0
8737
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8610
tracyyun
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...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4168
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...
1
2735
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
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
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...

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.