|
Try enabling double buffering and see if that helps.
The cause of flicker is that you can see each part of the window being redrawn, starting with erasing the current contents. If you enable double-buffering all the drawing will be done off screen, then once the drawing is done it will draw that image to the screen.
James
Simplicity Rules!
|
|
|
|
|
Thanks...
Did MFC had the double-buffering embedded in the controls? I never heard of double-buffering for MFC controls and they never flickered...
|
|
|
|
|
Don't know, both are wrappers around the Tree control provided by Windows so I would assume it wouldn't interfere too much.
James
Simplicity Rules!
|
|
|
|
|
I'm disappointed that I have to do extra stuff in .net to make the control look as they usually looked...
|
|
|
|
|
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 );
|
|
|
|
|
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
|
|
|
|