473,765 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image visible during background process

Hello. I have a process that can take a long time and I'm trying to put an
animated gif while the user is waiting.

I added a panel with a picturebox with the image inside. The panel is not
visible when the application starts, but before the process, I make it
visible.

The problem is that while the long process is running, the image doesn't
appear. The panel is empty.

How can I ensure that the animated gif is shown?

--

Regards,

Diego F.

Apr 10 '07 #1
4 2337
On Apr 10, 7:15 am, "Diego F." <diego_f...@msn .comwrote:
Hello. I have a process that can take a long time and I'm trying to put an
animated gif while the user is waiting.

I added a panel with a picturebox with the image inside. The panel is not
visible when the application starts, but before the process, I make it
visible.

The problem is that while the long process is running, the image doesn't
appear. The panel is empty.

How can I ensure that the animated gif is shown?

--

Regards,

Diego F.
Are you running the "long process" on the main UI thread or on a
seperate thread?

Thanks,

Seth Rowe

Apr 10 '07 #2

"rowe_newsgroup s" <ro********@yah oo.comwrote in message
news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
On Apr 10, 7:15 am, "Diego F." <diego_f...@msn .comwrote:
>Hello. I have a process that can take a long time and I'm trying to put
an
animated gif while the user is waiting.

I added a panel with a picturebox with the image inside. The panel is not
visible when the application starts, but before the process, I make it
visible.

The problem is that while the long process is running, the image doesn't
appear. The panel is empty.

How can I ensure that the animated gif is shown?

--

Regards,

Diego F.

Are you running the "long process" on the main UI thread or on a
seperate thread?

Thanks,

Seth Rowe
Actually I'm running that process in the main thread. I can run it in a
separate thread with the Backgroundworke r, but then I need to stop the
execution until it's finished. How can I do that?

--

Regards,

Diego F.

Apr 10 '07 #3
I found that code:

Private _dataLock As New ManualResetEven t(False)
Me.BackgroundWo rker1.RunWorker Async()
_dataLock.WaitO ne()

and in the DoWork method...
_dataLock.Set()

The problem is that the application stops completely and the gif animation
is not shown, so I'm in the same point again.

--

Regards,

Diego F.


"Diego F." <di********@msn .comwrote in message
news:uD******** ******@TK2MSFTN GP04.phx.gbl...
>
Actually I'm running that process in the main thread. I can run it in a
separate thread with the Backgroundworke r, but then I need to stop the
execution until it's finished. How can I do that?

--

Regards,

Diego F.

Apr 10 '07 #4
On Apr 10, 10:12 am, "Diego F." <diego_f...@msn .comwrote:
"rowe_newsgroup s" <rowe_em...@yah oo.comwrote in message

news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
On Apr 10, 7:15 am, "Diego F." <diego_f...@msn .comwrote:
Hello. I have a process that can take a long time and I'm trying to put
an
animated gif while the user is waiting.
I added a panel with a picturebox with the image inside. The panel is not
visible when the application starts, but before the process, I make it
visible.
The problem is that while the long process is running, the image doesn't
appear. The panel is empty.
How can I ensure that the animated gif is shown?
--
Regards,
Diego F.
Are you running the "long process" on the main UI thread or on a
seperate thread?
Thanks,
Seth Rowe

Actually I'm running that process in the main thread. I can run it in a
separate thread with the Backgroundworke r, but then I need to stop the
execution until it's finished. How can I do that?

--

Regards,

Diego F.
I wouldn't use the BackGroundWorke r, but thats just me. I would create
a class that wraps the method and contains a "WorkFinish ed" event that
fires when the task is done. Then you just have to instantiate the
class, subscribe to it's WorkFinished event, and call it's Begin()
method - the class will take care of spawning the new thread and will
notify you when it's done.

Something like this:

' Typed in message

Public Class MyThreadWrapper

public sub new()

end sub

public sub Begin()
Dim t as new thread(addresso f DoTheWork)
' Set any necessary properties for the thread
t.Start()
end sub

private sub DoTheWork()
' Do the long process
RaiseEvent(Work Finished(me, EventArgs.Empty ))
end sub

public event WorkFinished as EventHandler

End Class

Thanks,

Seth Rowe

Apr 10 '07 #5

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

Similar topics

5
3486
by: Chris Beall | last post by:
I'm displaying an image that is also a link against a black background. In Netscape 7.1, the current background color is displayed as a horizontal bar below the image. This allows :hover effects that change the background color to have a visible effect, as this bar changes color. By default, it appears that the color is inherited from the body color, i.e. with no link style applied, the bar is black, and invisible against the background....
8
2409
by: Michael Satterwhite | last post by:
I'm opening a page that has a single image on it. I'd like to resize the window containing the image to the size of the image (slightly larger OK, not smaller). The width isn't a problem, but the height is. The window, of course has things like menu bars, toolbar, navigation, etc. I need to account for these when I resize the image, but I'm not seeing how to do that. I'm sure this must be done frequently, but I'm not seeing the solution. ...
6
2324
by: Jerry Camel | last post by:
I want to center an image on the screen and have text centered over the image. What's the best way to do this? I've been playing with style tags and I can get the stuff to center automatically OR have the text appear on top of the image. But in the second case, the image and text aren't centered properly. Any help is appreciated... Jerry
5
3389
by: aiki727 via DotNetMonster.com | last post by:
Hello everyone, Where do I store a bitmap or jpeg that I am using for a forms background image when I deploy the application? Or do I link these files to the app during the deployment? Thanks -- Message posted via DotNetMonster.com
8
2179
by: pamelafluente | last post by:
I am reposting hoping better luck :) I can't achieve this simple thing: I have an animated gif in an image control (ImageProgress1). The image visibility is set to false. I want that when the User click on a given button (ButtonSomeLongTask) to execute a long task Me.ImageProgress1 become visible until the task on the server is finished. I call the task this way: Protected Sub ButtonSomeLongTask_Click(ByVal sender As Object, ByVal e...
8
3942
by: Warren Post | last post by:
At <http://snow.prohosting.com/srcopan/dry/test.es.html>, you will see that the background image runs down the left margin. The right hand side of it is faded, watermark style, but it is one single image. my intention is for the header and text to appear to the right of the unfaded portion of the image, and on top of the watermarked portion. At most viewport widths it works as intended. However, if the viewport is narrowed enough to...
3
5669
by: seamlyne | last post by:
The first method I ever used for multiple state buttons was to create a graphic for each button for each state: AboutUs_on, AbooutUs_over, AboutUs_out, etc. That works great when there are just a few buttons. I'm creating interfaces now with many more buttons than "just a few". I solved the maintenance problem by having generic button images, one for each state, and having them be background images for text containers, DIVs in this...
10
6778
by: cjparis | last post by:
Hello everyone. If anyone can give me a hand I would be gratefull Am doing a site which requires a moving element and have used DHTML to do it. Have a simple Browser detect script to sort IE from Netscape. IE is ok but the Netscape browser including Firefox and Safari are not working now. Not sure why. The idea is that when you mouseover the arrows the gallery div moves to left and right. I have changed the script and now the image...
6
1677
by: shapper | last post by:
Hello, I need to display a ranking using starts. 1 to 5. Can I create a single star image and then create, at runtime, the ranking image for each record using 1 to 5 stars? How can I do this? Thanks,
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9399
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
10007
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...
1
9955
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,...
0
9833
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...
0
8831
agi2029
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...
0
6649
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();...
0
5275
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...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.