|
You may be able to use DirectX or OpenGL. I know it seems like overkill to use a 3D engine to display simple text, but graphics cards are built for speed. Of course, you will have to handle all aspects of the display yourself. Disclaimer: I've no clue how fast text can be written in either DirectX or OpenGL.
|
|
|
|
|
Hi,
I concur with Dan: a ListBox is a lot faster than a TextBox when large amounts of text
are involved.
But then you must be aware a Windows system is not a real-time system, under some
circumstances (garbage collection, floppy access, antivirus activated, high network
traffic, ...) it will be unable to cope with an external device producing data at a
high and uninterruptible rate. IMHO you should provide at least one of the following:
- a sufficient buffer inside the external device;
- a start/stop communication protocol;
- a retry facility
Some additional thoughts:
1. maybe you are only interested in the last N lines of information,
in that case organize the listbox in such a way that it throws away the oldest lines
when new lines come in, avoiding it to grow without limit.
2. once a control contains 100,000 lines of text it becomes practically useless: it
gets very hard to navigate, you typically dont find anything anymore.
3. you may reduce the CPU load caused by the listbox by using AddRange() instead of
Add() effectively adding say 10 lines at once; or by using SuspendLayout()/ResumeLayout()
so it gets redrawn only every say 10 lines.
4. you may improve performance (at the expense of more code) by disconnecting your data
source and the listbox: have your own buffer scheme (preferable a circular buffer)
holding the last N lines of text, which are NOT added to a listbox; and a listbox (or
a simple Panel) which acts as a low-frequency view on say a sliding windows of a fraction
of those N lines.
|
|
|
|
|
Thanks a lot to everybody!!!!
|
|
|
|
|
Hi
I am having two projects(say dll1,dll2) with the same class name,functions and everything will be same, except the logic implemented in the functions.
An exe application is having reference to one of above specified dll (say dll1), But depends on requirement, at the runtime i would be using either dll1 or dll2. say the user wants to perform different logic that is implemeted in dll2, at run time i will rename and Place the dll2 in application bin directory (with name dll1).
But the application is crashing with dll2.
Is it possible to do like this way or anyother way to achieve this requirement?
|
|
|
|
|
You may want to look at the assemblyBindings section of the config file. Possible you could use bindingRedirect to switch assemblies in the config for each application deployment.
Otherwise you will need to use Reflection to load the proper assembly and runtime.
only two letters away from being an asset
|
|
|
|
|
Hello,
I have a TreeView in my application which I wish to disable once an action was taken. I am using the following line for doing so but the problem is that it also Disables my Scrollbar.
The Code:
treeView1.Enabled = false;
Is there anyway to have Scrollbar active while the TreeView is not selectable?
Thank you for your help.
Khoramdin
|
|
|
|
|
I think the following should work for you assuming that you have the referenced boolean value that indicates whether selections are allowed:
private void treeView1_BeforeSelect(object sender, TreeViewCancelEventArgs e)
{
e.Cancel = (_treeDisabled);
}
|
|
|
|
|
|
The Microsoft help says:
Note: This event is new in the .NET Framework version 2.0.
Usually that means there isn't anything like it in 1.1
Still if you want to have your form only do something once then perhaps you should consider the form load event.
Hope that helps.
Ben
|
|
|
|
|
I guess that's what I need.
However I would like to see a graph of all the events fired when a form is loaded.
And the orders of those events
company, work and everything else @ netis
|
|
|
|
|
Here is what is in the Microsoft help file:
Application Startup and Shutdown Events
The Form and Control classes expose a set of events related to application startup and shutdown. When a Windows Forms application starts, the startup events of the main form are raised in the following order:
System.Windows.Forms.Control.HandleCreated
System.Windows.Forms.Control.BindingContextChanged
System.Windows.Forms.Form.Load
System.Windows.Forms.Control.VisibleChanged
System.Windows.Forms.Form.Activated
System.Windows.Forms.Form.Shown
When an application closes, the shutdown events of the main form are raised in the following order:
System.Windows.Forms.Form.Closing
System.Windows.Forms.Form.FormClosing
System.Windows.Forms.Form.Closed
System.Windows.Forms.Form.FormClosed
System.Windows.Forms.Form.Deactivate
The ApplicationExit event of the Application class is raised after the shutdown events of the main form.
Ben
|
|
|
|
|
Thanks that is most helpfull. Do you have a link for that?
As I see this is for .Net > 2.0
company, work and everything else @ netis
|
|
|
|
|
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxmancli/html/e81db09b-4453-437f-b78a-62d7cd5c9829.htm
Ben
|
|
|
|
|
Is there someone who could help me with this please
What I want to do is that:
1) Execute the server on my machine.
2) Through that server, initialize/execute the clients(.exe) on the client machines(known machine-names/IP addresses).
3) Clients will then start communication with the server.
I actually need help with that 2nd step.
PsExec looks to be interesting, but I want that step 2 to be done by my server.
---------------------------------------------------------------------------------------------
Like for example when I do something like this:
Process proc = new Process();
ProcessStartInfo info = new ProcessStartInfo("C:\\client.exe");
proc.Start();
The above will execute the client.exe on my C drive.
But I want to execute this file on other machines residing on the same network (LAN).
Thanks.
Sarfraz.
-- modified at 11:27 Tuesday 27th February, 2007
Sarfraz
|
|
|
|
|
|
This looks like to be some thing that I actually need:
ConnectionOptions objConnectionOptions = new ConnectionOptions();
objConnectionOptions.Impersonation = ImpersonationLevel.Impersonate;
objConnectionOptions.EnablePrivileges = true;
objConnectionOptions.Username = strUserName;
objConnectionOptions.Password = strPassword;
ManagementScope objManagementScope = new ManagementScope(@"\\remote-machine-name\ROOT\CIMV2", objConnectionOptions);
objManagementScope.Connect();
ManagementClass processClassFinal = new ManagementClass(objManagementScope, new ManagementPath("Win32_Process"), null);
ManagementBaseObject inParamsFinal = processClassFinal.GetMethodParameters("Create");
inParamsFinal["CommandLine"] = @"\\remote-machine-name\some-directory\someProgram.exe";
ManagementBaseObject outParamsFinal = processClassFinal.InvokeMethod("Create", inParamsFinal, null);
But for some reason it does not work and I don't know why???????
outParamsFinal["processId"] returns null, instead of a valid processId.
Is there any one who could help me in that..............
Thanks
Sarfraz
|
|
|
|
|
What is the best solution for store html/javascripts scripts?
I want to store alot of html/javascripts codes as a ? maybe array or db or?, what is the best solution for that? I cant use sql unless, I can build it in the program.
If it's possible, then I dont want to do this every line:
html += "<html>\n"
+"<head>\n"
+"<meta........
It most be easy!
Thanks!
PS: It would be great with some code examples because I am neally started on C#/C Sharp
|
|
|
|
|
You could store the html/javascript in resource files.
only two letters away from being an asset
|
|
|
|
|
Thanks for the quick answer!
I have tried that but then a have to call every single code as
"string code = Resource1.String1.ToString();" or is there i better solution for doing that?
Thanks
|
|
|
|
|
Are you saying you want to store each html tag as a different resource then concatentate them together to form a page?
only two letters away from being an asset
|
|
|
|
|
No thats what i dont want to but i very new in C#, so how can i do it more easy?
|
|
|
|
|
Create a complete html or javascript file and store it as a resource.
only two letters away from being an asset
|
|
|
|
|
Sorry i ask agian but how do i load it into the program?
|
|
|
|
|
|
Thanks !
|
|
|
|