|
hi,
So when ever you click on form say , for activating or deactivating you need to re- draw the client area. I mean the base form. Right. You can call Invalidate() of your base class to re-draw the region. And also you can try use DoubleBuffering to avoid flickering. I know this is not at all ultimate for you. But this is what i can suggest you now. Why i suggest you the double-buffering is, that you are trying to customize your title bar.
Sreejith Nair
|
|
|
|
|
hi
do u have any clue how to achieve DoubleBuffering in C# if yes please help me
thanx
|
|
|
|
|
hi,
In this point of time, I can't sound much in GDI+ .What i can do is , i can suggest one url page for you. There you will get more nice articles which will guide you to , how to use Double Buffering.
http://www.codeproject.com/script/Articles/list_articles.asp?userid=6556
please go to the Multimedia -> GDI + link. There you will get nice stuffs for DoubleBuffering with very nice exapmle.
Sreejith Nair
|
|
|
|
|
Hi Asif,
Add Paint Event handler and below line of code. This will solve your problem.
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
this.graphics = e.Graphics;
}
Do Revert back whether it could solve your problem or not.
Regards,
Jay.
|
|
|
|
|
this.graphics contains the handle of Non Client area if i equal it to my client area how will i paint over NC
thanx
|
|
|
|
|
Hi Asif,
Check out this code....
[DllImport("User32.Dll")]
public static extern IntPtr GetSystemMenu(int hWnd, bool bRevert);
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
IntPtr hTitle = GetSystemMenu(this.Handle, false);
this.graphics = Graphics.FromHwnd(hTitle);
}
Regards,
Jay.
|
|
|
|
|
GetSystemMenu only gets the graphics handle for the system menu .
i have the graphics handle for non client area but the problem is when i draw an image over another image it flickers is there any concept of double buffering
by
|
|
|
|
|
|
|
Hi,
I'm using a PropertyGrid on a form to display the properties of a Control. But my property grid only contains a property page - the events page is missing. So I tried to add the events page with
System.Windows.Forms.PropertyGrid.PropertyTabCollection coll = myPropertyGrid.PropertyTabs;
coll.AddTabType(typeof(System.Windows.Forms.Design.EventsTab));
When I use coll.Count() to receive the numbr of tab pages it is still 1 (the property page). I also tried the Microsoft Example and inherited my own event tab page class and used it for a UserControl with
[PropertyTabAttribute(typeof(TypeEventsTab),PropertyTabScope.Component)]
This works fine in Design time in Visual Studio but not at runtime for the property grid on my form. What's wrong?
Claudia
|
|
|
|
|
Claudia Peschke wrote:
This works fine in Design time in Visual Studio but not at runtime for the property grid on my form. What's wrong?
You will have to fool the enviroment that it is in design mode then. google for "designerhost"
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
Hi all,
How can i program outlook express in c#, e.g. get email items in
the inbox of outlook, activate outlook express to check emails ?
Thanks
Patrick
|
|
|
|
|
Hi simplest question how i can convert System.UInt32 to Integer and backward.
THANK
|
|
|
|
|
System.UInt32 u = 0;
int x = (int)u;
u = (UInt32)x;
Just be carefull that the values are valid or you will get an exception.
Incase you are going to try and catch it i think the exception is InvalidCastException but i'm not sure on that one.
Kev
|
|
|
|
|
exhaulted wrote:
Just be carefull that the values are valid or you will get an exception
You won't unless you ask for one. C# will just convert it without fuss even if the value is out of range for the new type.
exhaulted wrote:
the exception is InvalidCastException but i'm not sure on that one
It is a System.OverflowException
Do you want to know more?
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
So long as the values are in the range 0 to 2147483647 then there are no problems.
If you exceed the upper value the operation overflows. For instance: (int)UInt32.MaxValue results in -1 (negative one). This does NOT throw an exception.
If you need an exception to be thrown you can wrap the casting operation inside a checked statement.
Consider this code:
uint a = UInt32.MaxValue;
Console.WriteLine("a = {0}", a);
int b = (int)a;
Console.WriteLine("b = {0}", b);
int c = checked((int)a);
Console.WriteLine("c = {0}", c);
Does this help?
Do you want to know more?
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
I'm trying to insert by using adapter1.Update(dataset1);
but I get an exception
Devil Linux
|
|
|
|
|
What exception did you get????
Have you included a primary key in the table in your dataset?
The update method requries the primary key to be able to update.
Kev
|
|
|
|
|
Have just read your Subject again, are you trying to update your table using the update statement? If so then you should know that the update method of a dataAdapter is only used to update a database with changes made in your dataSet.
To insert rows into your table you need to use the dataAdapter.Fill() method.
Kev
|
|
|
|
|
I'm looking for some code which do the dial up through phone line?
would be nice if anyone can share thier code with me.
|
|
|
|
|
To see what I am talking about, create a WinForm application and add a RichTextBox to the form. Compile the application and run it.
Start typing into the richtextbox. Then paste an image into it. Then continue typing on the line below or above the pasted image. The flicker is unbearable.
If someone can give me some direction on overriding the OnPaint(PaintEventArgs pe) event to be able to successfully paint both images and text, it would be helpful and very much appreciated.
I posted once before and nobody provided any solution.
Thank you in advance for any help.
JB
|
|
|
|
|
|
I have an application written in C++ that allows me to write addons. It has a public .h file with some class definitions. I can create .dll that has known entry point and that entry point will receive as one of it's parameters pointer to internal class from the app.
Now I have C# library (that I use in other projects) and I want to use it within the application.
My first thought was to use regasm and use COM to do all the interop. Might work, but I've never done any COM from C++ and it looks a bit messy.
My second approach would be to use managed C++ (which I haven't tried either).
So my question is:
If I write my .dll with managed c++ and use my library (written in C#), will the application be able to load the library? How will CLR be loaded? This lib is written for .net 2, and I can use the new CLI C++, which looks nicer than 1.0
Also, If I have static objects within my library, will those be loaded upon each call?
Thanks.
|
|
|
|
|
Hi,
My suggestion is ,
Create Com (ActiveX Dll),using ATL.It's very simple .And u Don't Have To Break Heads On it.
Start -> ATLCOMAPPWIZARD -> Create Simple Object , This Will Your Interface from Outside.Okay,
Now,
Create Methods Exactly With Same As In Your Class written C++ [ ".cpp And .h"].
Each Methods In The Interface Will Actually wraps The Methods In Your .cpp .
For Example :-
Your C++ Class Implements add Fuction
YourClass.add(long a, long b)
you just call this method from
YourDll.Add(long a,long b)
create the dll.
u can add this dll into C# project.By Add reference Method
[Note:- U Can Use This In Any Language that Supports COM]
Okay.Any doubts feel free to contanct me
by
baijumax
|
|
|
|
|
I think you misunderstood my question.
I have .net library that I need to use from within C++.
I do not need to expose C++ as COM, I wanted to expose .net as COM and use it from within C++.
|
|
|
|