How to insert a web link?
Two quick and easy
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > .Net Development > Two quick and easy 30 July 2005 06:01:23

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Two quick and easy

Steve 30 July 2005 06:01:23
 Hello,

First I have a label that basically says "Proceessing
CurrentRecordNumber­ out of MaxRecordNumber" but it doesn't display until all
the records have been processed. I am using a Progress bar and it updates as
it goes but I would also like a numeric read out. So the question is how do
you make the label.Text update while it is processing. I couldn't find
anything on it in MSDN.

Second I have a multi-line text box, according to MSDN if you set
the properties Multiline to ture and word wrap to true it will wrap, however
I want to insert linebreaks and "\n" isn't working so what do I have to add
to end of each line to create line breaks?

Thanks

Add comment
Peter Ritchie 29 July 2005 19:54:47 permanent link ]
 You have to spawn a background thread to perform the operation that may
take more than a second or two. That background thread must then Invoke
methods in the form to update the GUI.

There are several good threads that have been started recently on this
subject either in DOTNET-WINFORMS or elsewhere on discuss.develop.com­.

http://www.peterRit­chie.com/

On Fri, 29 Jul 2005 11:10:09 -0500, Steve <steve@MSMARKETING.­BIZ> wrote:
Hello,>
First I have a label that basically says "Proceessing>Curren­tRecordNumber out of MaxRecordNumber" but it doesn't display until
the records have been processed. I am using a Progress bar and it updates
it goes but I would also like a numeric read out. So the question is how
you make the label.Text update while it is processing. I couldn't find>anything on it in MSDN.>
Second I have a multi-line text box, according to MSDN if you set>the properties Multiline to ture and word wrap to true it will wrap,
however>I want to insert linebreaks and "\n" isn't working so what do I have to
to end of each line to create line breaks?>
Thanks

Add comment
Greg Robinson 29 July 2005 20:17:17 permanent link ]
 As you update the progress bar, why not update your label? I assume you
have some sort of incrementing on the progress bar..as you increment, update
your label.

If Not myProgressBar.Value­ + 1 = myProgressBar.Maxim­um Then
myProgressBar.Value­ += 1
' update my label
End If

For your second one, perhaps Environment.NewLine­ Property or VbCr.

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [mailto:D­OTNET-WINFORMS@DISCUSS.DEVELOP.COM]On Behalf Of
Steve
Sent: Friday, July 29, 2005 12:10 PM
To: DOTNET-WINFORMS@DIS­CUSS.DEVELOP.COM
Subject: [DOTNET-WINFORMS] Two quick and easy


Hello,

First I have a label that basically says "Proceessing
CurrentRecordNumber­ out of MaxRecordNumber" but it doesn't display until all
the records have been processed. I am using a Progress bar and it updates as
it goes but I would also like a numeric read out. So the question is how do
you make the label.Text update while it is processing. I couldn't find
anything on it in MSDN.

Second I have a multi-line text box, according to MSDN if you set
the properties Multiline to ture and word wrap to true it will wrap, however
I want to insert linebreaks and "\n" isn't working so what do I have to add
to end of each line to create line breaks?

Thanks

Add comment
Steve 29 July 2005 21:11:11 permanent link ]
 That is pretty much what I am doing

myProgressBar.Value­ = x;
'which is the counter for how many records have been processed.
this.lblProgressLab­el = "Processing " + x + " of " + maxRecords;
And like I said the progress bar updates just fine, but the label does not.
By the time it is displayed it says 'Processing 315 of 315'.

As far as the second this is a C# program so I am not sure if vbcr is valid.



-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps and
controls [mailto:D­OTNET-WINFORMS@DISCUSS.DEVELOP.COM] On Behalf Of Greg
Robinson
Sent: Friday, July 29, 2005 11:17 AM
To: DOTNET-WINFORMS@DIS­CUSS.DEVELOP.COM
Subject: Re: [DOTNET-WINFORMS] Two quick and easy

As you update the progress bar, why not update your label? I assume you
have some sort of incrementing on the progress bar..as you increment, update
your label.

If Not myProgressBar.Value­ + 1 =
myProgressBar.Maxim­um Then
myProgressBar.Value­ += 1
' update my label
End If

For your second one, perhaps Environment.NewLine­ Property or VbCr.

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps and
controls [mailto:D­OTNET-WINFORMS@DISCUSS.DEVELOP.COM]On Behalf Of Steve
Sent: Friday, July 29, 2005 12:10 PM
To: DOTNET-WINFORMS@DIS­CUSS.DEVELOP.COM
Subject: [DOTNET-WINFORMS] Two quick and easy


Hello,

First I have a label that basically says "Proceessing
CurrentRecordNumber­ out of MaxRecordNumber" but it doesn't display until all
the records have been processed. I am using a Progress bar and it updates as
it goes but I would also like a numeric read out. So the question is how do
you make the label.Text update while it is processing. I couldn't find
anything on it in MSDN.

Second I have a multi-line text box, according to MSDN if you set
the properties Multiline to ture and word wrap to true it will wrap, however
I want to insert linebreaks and "\n" isn't working so what do I have to add
to end of each line to create line breaks?

Thanks

Add comment
Jason Jones 29 July 2005 21:13:59 permanent link ]
 System.Environment.N­ewline should work. If you want to do it with
literals, I think you need /r/n (both carriage return and newline).

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [mailto:D­OTNET-WINFORMS@DISCUSS.DEVELOP.COM] On Behalf Of
Greg Robinson
Sent: Friday, July 29, 2005 12:17 PM
To: DOTNET-WINFORMS@DIS­CUSS.DEVELOP.COM
Subject: Re: [DOTNET-WINFORMS] Two quick and easy

As you update the progress bar, why not update your label? I assume you
have some sort of incrementing on the progress bar..as you increment,
update
your label.

If Not myProgressBar.Value­ + 1 =
myProgressBar.Maxim­um Then
myProgressBar.Value­ += 1
' update my label
End If

For your second one, perhaps Environment.NewLine­ Property or VbCr.

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [mailto:D­OTNET-WINFORMS@DISCUSS.DEVELOP.COM]On Behalf Of
Steve
Sent: Friday, July 29, 2005 12:10 PM
To: DOTNET-WINFORMS@DIS­CUSS.DEVELOP.COM
Subject: [DOTNET-WINFORMS] Two quick and easy


Hello,

First I have a label that basically says "Proceessing
CurrentRecordNumber­ out of MaxRecordNumber" but it doesn't display until
all
the records have been processed. I am using a Progress bar and it
updates as
it goes but I would also like a numeric read out. So the question is how
do
you make the label.Text update while it is processing. I couldn't find
anything on it in MSDN.

Second I have a multi-line text box, according to MSDN if you
set
the properties Multiline to ture and word wrap to true it will wrap,
however
I want to insert linebreaks and "\n" isn't working so what do I have to
add
to end of each line to create line breaks?

Thanks

**********
This message contains information which may be confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender by reply e-mail and delete the message.

Add comment
Greg Robinson 29 July 2005 22:16:52 permanent link ]
 We use a custom progress bar. Not sure how the framework one works, though
I assume you can increment it your self depending on the number of records?
I assume you are in a loop somewhere doing the processing?



-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [mailto:D­OTNET-WINFORMS@DISCUSS.DEVELOP.COM]On Behalf Of
Steve
Sent: Friday, July 29, 2005 12:10 PM
To: DOTNET-WINFORMS@DIS­CUSS.DEVELOP.COM
Subject: [DOTNET-WINFORMS] Two quick and easy


Hello,

First I have a label that basically says "Proceessing
CurrentRecordNumber­ out of MaxRecordNumber" but it doesn't display until all
the records have been processed. I am using a Progress bar and it updates as
it goes but I would also like a numeric read out. So the question is how do
you make the label.Text update while it is processing. I couldn't find
anything on it in MSDN.

Second I have a multi-line text box, according to MSDN if you set
the properties Multiline to ture and word wrap to true it will wrap, however
I want to insert linebreaks and "\n" isn't working so what do I have to add
to end of each line to create line breaks?

Thanks

Add comment
Chris Anderson 30 July 2005 05:03:56 permanent link ]
 
First I have a label that basically says "Proceessing>Curren­tRecordNumber out of MaxRecordNumber" but it doesn't display until all>the records have been processed. I am using a Progress bar and it updates as

The problem (assuming you are setting the text property as you go) is that labels do not paint themselves when you change their Text property. They wait until the thread has finished what it's doing.
Label.refresh will redraw the label immediately.

Alternatively, do the processing in another thread, and post progress messages to the UI thread via a delegate. This will have the additional benefit of the rest of the form painting itself if it's covered by another window during processing, allowing the user to move the form around, etc.

Merak

Add comment
Alex Smotritsky 30 July 2005 06:01:23 permanent link ]
 Chris Sells' articles on msdn and his book hooked me up for this sort of
stuff.

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps and
controls [mailto:D­OTNET-WINFORMS@DISCUSS.DEVELOP.COM] On Behalf Of Peter
Ritchie
Sent: Friday, July 29, 2005 8:55 AM
To: DOTNET-WINFORMS@DIS­CUSS.DEVELOP.COM
Subject: Re: [DOTNET-WINFORMS] Two quick and easy

You have to spawn a background thread to perform the operation that may
take more than a second or two. That background thread must then Invoke
methods in the form to update the GUI.

There are several good threads that have been started recently on this
subject either in DOTNET-WINFORMS or elsewhere on discuss.develop.com­.

http://www.peterRit­chie.com/

On Fri, 29 Jul 2005 11:10:09 -0500, Steve <steve@MSMARKETING.­BIZ> wrote:
Hello,>
First I have a label that basically says "Proceessing>Curren­tRecordNumber out of MaxRecordNumber" but it doesn't display until
the records have been processed. I am using a Progress bar and it updates
it goes but I would also like a numeric read out. So the question is how
you make the label.Text update while it is processing. I couldn't find>anything on it in MSDN.>
Second I have a multi-line text box, according to MSDN if you set>the properties Multiline to ture and word wrap to true it will wrap,
however>I want to insert linebreaks and "\n" isn't working so what do I have to
to end of each line to create line breaks?>
Thanks

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > .Net Development > Two quick and easy 30 July 2005 06:01:23

see also:
PostgreSQL 7.4 Error Codes and psqlODBC
OLAP versus Materialized Views?
Nasty security bug with clustering
пройди тесты:
see also:
internationlization and javascript
The Apache HTTP Server can be…
problem with TNSLSNR

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .