473,789 Members | 2,706 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1011
Hi,

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

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Arghknork" <Ar*******@disc ussions.microso ft.com> je napisal v sporoèilo
news:D6******** *************** ***********@mic rosoft.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.DoE vents() 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
1477
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? thanks in advance, ed
3
7432
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 bitching at .NET for the whole day now not being able to do something as simple as showing a textbox's content in a damn MessageBox... The TextBox.Text is a String... MessageBox takes a LPCSTR (plain single byte char*)... All our current code base...
13
1147
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? Paul
16
1652
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 code itself and shows the right help topic. This even worked more or less in VS2003. But in VS2005, if I highlight the "Host" method below and hit F1 I get a help topic on the "UriBuilder.Host" property. Huh????? That's dumb. Dim o as New...
4
1069
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 narrow if the development group also develops desktop applications, WinForms, And TabletPC products (such as we do). (FYI: We are being asked to come up with a new name)
2
6902
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 (which is the UI used to adjust the actions taken by, and the schedule of the service), then a privileged user thread should be used in the UI - no service required. But... "A windows service enables the creation of long-running executable
0
1655
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 files. From what I understand the .resx files house embedded resources, such as images and buttons texts. When I open up my winforms however there is nothing there! When I open up my winforms code behind, I see code such as: this.$ = new...
0
1248
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 administer sections of the site. In a little prototype, I was able to utilize Profile in the WinForms app! I added this to my app.config:
1
1699
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 to say fr-CA. How do I pass the value for the variable used to the following pages so that they too will be localized in the same language as the default page? In Winforms I would have declared a global variable and on a form load event do a...
2
949
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
9666
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
9511
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
10410
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...
1
10139
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
9020
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...
1
7529
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
6769
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
5418
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...
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.