473,410 Members | 1,977 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,410 software developers and data experts.

Really dumb Winforms question

I'm sure I'm going to feel stupid when someone answers this, but what am I
doing wrong?

I have a simple form that loads a text file and displays it in a listbox
with a progress bar based on the byte size of the file. Once the display
begins, I can't move the form - it just hangs up while it's filling. Also,
if I bring another window into focus, the scrolling display stops and doesn't
come back even if I bring my form back into focus.

This is a simple form I let the forms designer set up for me. What do I
need to change to fix this?
Nov 16 '05 #1
2 997
Hi,

You should run the "filling" in a separate thread.

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Arghknork" <Ar*******@discussions.microsoft.com> je napisal v sporočilo
news:D6**********************************@microsof t.com ...
I'm sure I'm going to feel stupid when someone answers this, but what am I
doing wrong?

I have a simple form that loads a text file and displays it in a listbox
with a progress bar based on the byte size of the file. Once the display
begins, I can't move the form - it just hangs up while it's filling.
Also,
if I bring another window into focus, the scrolling display stops and
doesn't
come back even if I bring my form back into focus.

This is a simple form I let the forms designer set up for me. What do I
need to change to fix this?

Nov 16 '05 #2
Hi,

As Peter said, you might benefit from threading.
There is a simpler, but perhaps not as elegant, way of reading x bytes
from the file, and then use Application.DoEvents() to handle any waiting
windows events like moving the listbox, then read some more, etc, in a
loop.

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #3

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

Similar topics

3
by: ed | last post by:
I've just started working with .Net, so appologize for what is probably a really dumb question. Did Windows XP originally come with the .Net framework installed, and if so which version? ...
3
by: Sin | last post by:
I'm currently evaluating VC.NET as the new platform for the company I work for and things are looking grim... We're up against another IDE which took me about 5 minutes to master and I've been...
13
by: PJ6 | last post by:
Are there any plans for broswers to support a real language client-side, and not just "cripple script"? Will we ever have the luxury of programming using Framework classes client-side some day? ...
16
by: CMM | last post by:
Is it me or has anyone noticed that F1 is really dumb in VS2005. Since VB3 I have been able to click F1 on an ambiguous method in code and the IDE automatically determines the type based on the...
4
by: Ray Stevens | last post by:
This may seen trivial, but I am wondering if anyone has a good name for their .NET development group. "Client Server" is too old fashioned, "Open Systems" too UNIX biased, and "Web Development" too...
2
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app...
0
by: netflex | last post by:
Working on a handed off C# project and pretty much my third time dipping into C#. In my solution file, I have a collection of .resx files in their own folder, several .cs files, and my winforms .cs...
0
by: BigDave | last post by:
Hi all, I tried this question in the WinForms forum, but perhaps I'll have better luck here. We have an ASP.NET 2.0 web app which uses Profiles, and want to write a little WinForms app to...
1
by: rdufour | last post by:
My web site needs to be localized, so did some googling and found out how to do a page, So I have page Default.aspx that has controls that display the localized text, and a threadcurrentculture set...
2
by: Chuck B | last post by:
Is it equally possible to create WPF objects for use in a web browser as well as WinForms?
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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...
0
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...
0
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...

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.