|
If you are adding many items, try using the BeginUpdate and EndUpdate methods on the TreeView.
|
|
|
|
|
It would work, but I want to see the list grow because I can take a while to read all the folders on a drive and I want browse them while the rest is loading.
|
|
|
|
|
I have an app that does something similar, and I think it's a lot nicer to load-on-demand rather that fill in the full control. To do this, you need to put a "pretend" node underneath each directory and then handle the expand event.
|
|
|
|
|
hi guys
i want to call ana exe when i press a button
i know that it's too easy bit i dont kn it !!!!
doudou
|
|
|
|
|
This should do it:
System.Diagnostics.Process.Start("ana.exe");
Nick Parker
|
|
|
|
|
I want to make a report in Crystal Report dynamicly. Anybody have some tips on how Can I create one directly by my C# program ??
I try to print a window form and it's work fine but the text in my TextBox is limited so I think I can get it using Crystal Report , but I don't know how to use it.
any documentation,Tutorial,Sample ???
Thanks
Jonathan Pouliot
|
|
|
|
|
|
Hi,
How do I create a COM component in C~ when i know the CLSID of the component, this CLSID is discovered in real-time so i can not add a reference to the DLL at compile time.
Cheers
|
|
|
|
|
The answer is....
Type comType = Type.GetTypeFromCLSID( new Guid( "12345678-0000-....") );
object comObj = Activator.CreateInstance( comType );
// if you have type infos (tlbimp/reference), try to cast:
YourCOMClass yourObj = (YourCOMClass) comObj;
// or for some special imported types, wrap:
// YourCOMClass yourObj = (YourCOMClass) Marshal.CreateWrapperOfType( comObj, typeof(YourCOMClass) );
To access remote by DCOM:
Type dcomType = Type.GetTypeFromCLSID( guid, "REMOTE_PC", false );
![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Can I set ReadOnly for a user control? I have some controls such as textbox , radiogroup, datagrid in my user control. I want to set all of them readonly in UserControl level. When I need read-write, I want to turn read-only off easily.
How to impliment this? Thanks.
Chris#
|
|
|
|
|
In your properties set function, set all the child controls according to what they have set the property to.
Nish
Check out last week's Code Project posting stats presentation from :-
http://www.busterboy.org/codeproject/
Feel free to make your comments.
|
|
|
|
|
Chris# wrote:
Can I set ReadOnly for a user control?
The framework won't do this, this is something that needs to be done on a case-by-case basis because ReadOnly doesn't make sense to everything (progress control for example).
Also you need to keep in mind that ReadOnly is only a UI state, code can still read/write to the controls, the controls just don't accept user input.
With those ideas in mind...
private bool isReadOnly = false;
public bool ReadOnly
{
get
{
return isReadOnly;
}
set
{
isReadOnly = value;
textBox1.ReadOnly = isReadOnly;
}
} Good Luck,
James
Simplicity Rules!
|
|
|
|
|
In the .net framework is there a function that would process any pending messages in the message queue for the current thread, so while reading folders from a hard drive I could still move the window around.
Thanks
|
|
|
|
|
|
Hi,
Sorry, I know it maybe a bit dumb to ask this question.
But if I wrote class library that inherit some MFC classes,
can I use them in my C# project?
Thank you in advance
|
|
|
|
|
If you used managed C++, then I believe so. Ask in the MC++ forum to be sure.
|
|
|
|
|
They can't live in the *same* project, but you can use them together if you write an MC++ class library which wraps the MFC classes, then you can use that from a C# app, rather easily I might add The hard/tedious part is going to be wrapping the MFC class.
James
Simplicity Rules!
|
|
|
|
|
|
They can leave in the same solution so you can P/Invoke the C# or the unmanged code from C#
Al
|
|
|
|
|
In my MFC application, I draw lines over graphics and text
controls.
void CAboutDlg::OnButton1( )
{
CClientDC dc( this );
dc.MoveTo( 0, 0 );
dc.LineTo( 200, 200 );
}
The black line will draw over anything on the form.
--------------------------------------------------------
Now, in C# I cannot figure out how to draw on 'top' of the
controls.
private void Button1_Click(object sender, System.EventArgs
e)
{
Graphics g = CreateGraphics( );
g.DrawLine( Pens.Black, 0, 0, 200, 200 );
}
When I want to draw this line, it draws on the background
and does not draw over the bitmaps or text.
So, how do I draw on top of all the objects in a form?!
Transparent controls are not an option in this case.
Thanks in advance!!
|
|
|
|
|
because you tell him to create a graphics for the Window Form you are using
ex : suppose the text you want to put on the form is a label called "lab"
- make this :
Graphics g = lab.CreateGraphics();
instead of CreateGraphics because if you only write CreateGraphics, it's the sams as this.CreateGraphics.
Do you understand ??
I hope I help you
Jonathan Pouliot
|
|
|
|
|
Yes, I definitely understand. Unfortunately, it's not that easy.
I am needing to draw from one control to another across the entire form. The code you showed me basically only lets me draw within one control.
The final application has two fingerprint images and lines connecting identifying features between the two.
|
|
|
|
|
hi
i have stored form names in an arraylist. i need to create an object of each form in the arraylist and display it....
but when i create an object say f1 of arraylist frmnum[0]....it gives an error...
i have no idea how to go about this.....do i need to use typecasting....if yes ....please tell me how
bye
![Frown | :(](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_frown.gif)
|
|
|
|
|
Yes is the answer to your question, you will need to typecast whatever you are getting back out of the ArrayList to the value type you need. This code cycles through the ArrayList arrlstApts which holds an array of points. To assign the value into apt we must cast it as such (Point[])
for(int i = 0; i < arrlstApts.Count; i++)
{
Point[] apt = (Point[])arrlstApts[i]
}
Nick Parker
|
|
|
|
|
i tried to typecast to Form type like this:
for(int i = 0; i < frmnum.Count; i++)
{
Form[] apt = (Form[])frmnum[i];
}
but it is giving an exception error saying "System Invalid Cast Exception" occurred
Additional Information :Specified Cast is not valid.
please tell me how to do it!
|
|
|
|