|
Dave Kreskowiak wrote: I believe the TextBox has to render the entire string no matter what's visibile.
Not if you turn off word wrap. With a constant height per line, the visible lines can be calculated using the scroll offset. I speak from experience that performance without word wrap is much better when huge amounts of text is involved.
|
|
|
|
|
Dig a little deeper with Reflector and you'll see that neither TextBox nor TextBoxBase maintain any .Net string at all - they are simply wrappers around the Win32 text box.
Anyone know, or care to guess, how Win32 handles a window's text value?
|
|
|
|
|
That's what I've been saying!!
All the Text property in a Win32 window is is a block of memory containing the string. The Text property uses SendMessage, passing a pointer to the .NET string, to communicate with the window and the window maintains the string using WM_SETTEXT, WM_GETTEXT, EM_REPLACESEL, ... The base window uses standard C memory functions to allocate and resize any blocks of memory it needs.
|
|
|
|
|
Yeah. My fingers got ahead of my brain and I posted my message before I saw that you had already said the same thing.
|
|
|
|
|
as Dave said, a ListBox is the preferred Control for showing line-oriented textual information. It would be happy holding thousands of lines of text for you, and continue accepting lots more, whereas a TextBox would come to a stand still.
Using TextBox.AppendText("someMore") is slightly better than using TextBox.Text+="someMore" , but it too suffers from the quadratic cost explosion.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Luc Pattyn wrote: it too suffers from the quadratic cost explosion
I think that only occurs when you have word wrap set to true. See my answer below.
|
|
|
|
|
So I tried again, and yes, my test shows TextBox and ListBox performances are comparable provided you set WordWrap false (the default value is true) and use AppendText.
It probably will not suffice to win me over, but it is good to know.
Thanks.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
In addition to what Luc and Dave said, try disabling word wrap. With word wrap enabled, the vertical position of the text depends on the wrapping of text above that line, so removing word wrap should help to prevent that calculation. I just tried that and it seems to not suffer a slowdown.
|
|
|
|
|
What is the best way of implementing pagination in gridview?
to get whole data atonce on load or to get on evrypage click ?
|
|
|
|
|
What if you had a 100,000 items to page through?? Getting that on every page refresh would be wasteful and take forever. You only retrieve what you need for the new page.
Search the articles for "gridview paging" and you'll find some good articles on it.
|
|
|
|
|
how to convert whole .hex file to .bin file
I can convert small string to binary but I want to convert whole .hex file to binary file.
bmchheda1@yahoo.com
a
|
|
|
|
|
The extensions .hex and .bin do not tell much about the files. Please tell us what is actually in the .hex file, and what is needed to be put into the .bin file. Does a .hex file contain hex numbers in text format? For the .bin file, do you just want to put the converted numbers one after another into it without any structure?
|
|
|
|
|
As the previous answer stated, we would need more info.
Do not post you email on any forum - unless you really like spam. Codeproject will send you emails as necessary to tell you when people reply. Edit your question, and remove it!
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Do you mean an "Intel Hex file" to plain binary data? (that's not very easy)
|
|
|
|
|
Hi,
I am writing an aplication which is a video player, but I have problems parsing and displaing the subtitles.
Can anyone help?
P.S. i am using DirectxAudioVidoPlayback in a windows form program.
Thanks
|
|
|
|
|
What's the issue that you're having? Could you post how you are trying to implment it?
|
|
|
|
|
That's my issue. I dont know how to parse it.
Could you give me a start point,pls?
|
|
|
|
|
Well I did this on really really old code quite some time ago so I'm assuming there's a better way but the logic was:
1)Capture the event when the video time changes
2)Parse the subtitle file (the one I was working with was a simple text one with the format [Time][Subtitle]) and determine which one should be showing at the time.
3)Have an overlaid transparent panel that matches the bottom of the player and display the relevant subtitle.
So admittedly, I haven't used the Directx library you're referring to, the logic should still be the same, a quick browse of the documentation indicates there's no native subtitle functionality built in.
Pretty sure there'll be another library out there that might help but if not, you've got the above approach as a fallback position (note - it's not exact logic as I was doing things there to reduce processing overhead but it's the basic idea).
|
|
|
|
|
Hi
I've written script in inno setup.
In [Files] sections I have:
Source: ..\out\Release\Plugins\Plugin.dll; DestDir: {app}\Plugins; Flags: ignoreversion; Components: Stubs\Plugin
And in [Components] section i have:
Name: Stubs\Plugin; Description: Hart Stub Modem; Types: custom
It works, but I want to install this plugin from ftp serwer.
I try like this:
Source: "ftp://myftpserver/plugin.dll;" DestDir: {app}\Plugins; Flags: ignoreversion; Components: Stubs\Plugin
But an error has occurred:
Mismatched or misplaced quotes on pararameter "Source"
Without quotas the error is: Unknown filname prefix "ftp:".
Does anyone know if it is posible to download dll file from ftp server?
rg
|
|
|
|
|
This question is about Inno Setup, so this isn't the right place to ask this question. I will say, though, that your error might be related to the semicolon after plugin.dll. Try removing it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I'd say you have misplaced the first semi-colon in
Source: "ftp://myftpserver/plugin.dll;" DestDir: {app}\Plugins; Flags: ignoreversion; Components: Stubs\Plugin
as well as the entire message.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
My program is in C#
I didn't found forum about Inno Setup
Source: "ftp://myftpserver/plugin.dll" DestDir: {app}\Plugins; Flags: ignoreversion; Components: Stubs\Plugin
Error: Mismatched or misplaced quotes on parameter "Source"
Source: ftp:
Error: Required paramter "DestDir" not specified.
Source: 'ftp://myftpserver/plugin.dll'; DestDir: {app}\Plugins; Flags: ignoreversion; Components: Stubs\Plugin
Error: Unknown filename prefix "'ftp:"
Source: "ftp://myftpserver/plugin.dll"; DestDir: {app}\Plugins; Flags: ignoreversion; Components: Stubs\Plugin
Error: Unknown filename prefix "ftp:"
|
|
|
|
|
That is pretty clear; the first two tell you "I don't understand what you want", whereas the last two are saying "I can't do that". Most programs can't access remote files over FTP. Do you think Notepad would be able to?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hello, I need of graphic objects (for example panel, picture box, etc..) that they can free-moving on a Form used the mouse and when these objects are a short distance, they must hook up each other like a magnet. For example, we can use two panel on a Form (panel 1 and panel 2). Panel 1 is on the left of Form and panel 2 is on the right of Form. If I push the bottom left of the mouse on the panel 1, I can move panel 1 to panel 2. When panel 1 is a distance of 10 pixel from panel 2, the right border of panel 1 will hook up to left border of panel 2, like a magnet.
|
|
|
|
|
There is nothing out of the box that will do this. You're on your own. The closest functionality for comparison would be the snap to grid feature in the designer. Is this a standard winform or WPF?
I know the language. I've read a book. - _Madmatt
|
|
|
|