|
hello,
I would like to thank everybody for helping me in my new C# experience.. I get quite blocked everytime I've to face with a new problem, so my is now to refresh a ListView...... suppose I've got a lview with 2 colums filename and size, I've them get filled at application startime, I've added an openFileDialog to choose another dir, but when I choose dir I get new files after the first loaded and not only the files of new dir..... I tryied using listview.clear(); , but I can't see any element...... any suggestion?
thanks
Paolo
|
|
|
|
|
ListView.Items.Clear()
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
I have a custom control that displays thousands of items. Each item is NOT a System.Windows.Control; each item is instead a simple light weight class with properties (such as .Text, .ImageIndex, etc.) used by the custom control to draw each item (i.e. the custom control draws all the items).
Here's my problem: I would like each item to display RichText. While we could write a custom RTF parser, that is a huge undertaking we'd not like to start. We cannot use the RichTextBox provided with the FCL since it is a standard System.Windows.Control which is not at all lightweight (thousands of items == thousands of RichTextBoxes, translates to bad performance plus lots of limitations related to standard WinForm Controls).
So I guess I'm looking for a way to display Rich Text items, thousands of items, all on a single GDI+ surface, without utilizing thousands of RichTextBox controls. Any suggestions?
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
|
Thanks for that Heath, I'll give it a peek.
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
Ok it looks promising. I've got a couple of questions though, hopefully you've got my answers for me Heath.
Since I want to be outputting the rich text to a GDI surface rather than a printer, my thought is that I should use SendMessage and pass a WM_PAINT message. Is that what I should be doing? If so, I fail to see how I can pass the rich text to be drawn on that control. Or should I not be using WM_PAINT at all?
---------------------------
He who knows that enough is enough will always have enough.
-Lao Tsu
|
|
|
|
|
Forget about all the painting-related stuff in the article (the code at the bottom of the article). The important thing is giving the FORMATRANGE.hdc field a valid HDC and passing that struct to the RichTextBox *. It will paint the RTF in that range to the HDC . This device context handle could come from the container control that contains all your little drawing helpers, or they could create their own (though that'd be a little less efficient, but it depends on your circumstances.
* You could use a single RichTextBox to help you paint all your RTF. So long as it's not visible nor added to a container control's Controls property collection, it should be pretty efficient and certainly takes care of the task of parsing and painting the RTF to a device context.
Keep in mind, however, that the RichTextBox merely encapsulates the Rich Edit common control. If you wanted, you could encapsulate that with your own little bare-bones control, just enough to wrap and create the proper window class, or - even better - use Windowless Rich Edit Controls[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How can i send files from Ftp Server to clients?...
also...i want afree source for a ftp server in C# Language
|
|
|
|
|
Did you look at the articles under the C# tab here at CP? There are several that discuss this (i.e.; search for FTP).
- Nick Parker My Blog | My Articles
|
|
|
|
|
The stock C# Windows toolbar is great. It does all I need to do. However, it there a way to make it vertical rather than horizontal?
thansk
|
|
|
|
|
Set the <cdoe>Dock property to DockStyle.Left or DockStyle.Right .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Hi I am trying to deploy a program that includes a report built with Crystal Reports for .Net. The Report works fine on my computer but gives a error "Cannot find keycodeV2.dill, or invalid keycode" when I try to display the report on another computer. I have been on a lot of message boards and have found that a lot of people have been having this problem.
I know that I need to have the Crystal Reports merge modules included with my project. I am new to .Net and I am not sure that the I included the merge modules in my project correctly. This is what I did.
1. Right clicked the deployment project in the solution explorer.
2. Moved to "Add" on the menu.
3. Clicked "Merge Module" on the menu.
4. Found the merge modules in the Add Modules dialog box.
Is this all I need to do to include these merge modules in my project? Am I leaving something out? Is the problem elsewhere?
|
|
|
|
|
See Deploying Windows Applications with Crystal Reports[^] in the VS.NET documentation. Besides the 3 MSMs required for the Windows Forms client, you also need to change a custom property for the Crystal_regwiz2003.msm that includes the registration code emailed to you when you (should have) completed the registration wizard when you began using Crystal Reports for VS.NET.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Mr. Stewart I think that worked but now I'm getting an error that says "invalid report file path". Do you know what could be wrong?
|
|
|
|
|
Nevermind!! Thanks for the help.
|
|
|
|
|
At runtime? This means that the report definition (.rpt file) is not being found. Paths to things like this are good to stick in the application's .config file, and make sure your report definitions are being installed as well. Never in your source assume a particular path unless it is relative to the application directory (which may be different from the current working directory).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
Is there a way to have an MDI child form without the maximize and minimize box?
TweeZz.
|
|
|
|
|
Just set both MaximizeBox and MinimizeBox to false for the MDI child form, same as you would do for a parent form if you wanted to.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Stewart,
Before my post I already tried to put these both propertys to false.
The window state of my MDIChild is Maximized; I don't want the user to be able to make it smaller, that's why I don't want the min and max to be there.
The difference with a normal form is that the max and min boxes stay visible, but disabled. So that should solve the problem you might think... But... When initialy this MDIChild is Maximized, there are 3 buttons in the right upper corner: minimize, restore down and close. The minimize button is disabled, the other to stay enabled. When I then press the restore down button, the form resizes and after that the user can move the form. I tried to put the minimumsize of the child to the size it has when it's maximized, but the user can still move it and see other child forms. I don't want this to happen
After I press the restore down button, the min and max button disappear and the user can move the form and make other childs visible.
I hope you understand what I'm trying to explain
GreetZz,
TweeZz.
|
|
|
|
|
Rather than going to all the trouble of overriding this behavior by handling non-client painting in .NET, just use a container control like the UserControl and swap the diffrent instances in the placeholder in your main form, like a Panel or something. To swap the container controls, just remove the previous instance from the Panel 's Controls collection property and add the new one. Keep an internal collection of the instances of the container controls so you can refer to them easily.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Any ideas on how a server object could detect database triggers and subsequently broadcast events (with updated data) to listening clients ?
Thanks
GK
|
|
|
|
|
See the SQL Server Notification Services[^]. It's designed for these sorts of scenarios.
The only other way would be to create an extended stored proc (xp proc) that the trigger called that would use whatever code is necessary to broadcast or queue your notification message that clients could subscribe to receive (such as using MSMQ or some other asynchronous mechanism - synchronous would not be recommend!).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks I will look into these
|
|
|
|