|
Hi,
if you are using .NET there is no need for unmanaged code, BitBlt, Decide Contexts, ...
when printing.
Basically the code that is used to paint to the display is reused to paint to the printer.
So render your page on the display the way you want it, then use the normal printing
mechanism to get it printed.
I have a very simple example in my Sokoban article.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I need to open a new form in the same boundaries as the old one (so that it completely covers the old one), and when I move the new one, that the old ones moves also. The point is that the users can't see the old form until he finishes with the new one.
Any idea how to achieve this?
Thanks
|
|
|
|
|
Hi,
If it is the case, then why dont you hide the old form till you complete the new form operation. Once the new form operation completed, then you can make visible your new form true.
Regard
A AntonySP
Good Is Not Good When Better Is Expected.
|
|
|
|
|
Yeah, I guess I could do that, but I want the functionality similar to that when you install a new program, you have to click next->next->... and so on, and the all appear in the same boundaries...
|
|
|
|
|
Isn't there a wizard control built into Winforms ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ok,
If the old and new form having parent and child relationship then trigger the OnMove event of current new form. Inside that write the code like
this.parent.location=this.location.
Hope this logic will help to you.
Regards
A AntonySP
Good Is Not Good When Better Is Expected.
|
|
|
|
|
Thanks to everyone who took the time to help me
I think I've finally figured it out
Thanks again
|
|
|
|
|
My prefered method is to define both forms as controls, put them on the one form, and swap between them.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Is there some tutorial on how to do that? I can't really hit the right keyword on Google...
|
|
|
|
|
It's super easy. Create controls instead of forms, make them the same size, ise the visible property to make sure one is always visible and they are never both visible at once.
But, I think for what you want to do, I'd google C# Wizard.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hi,
I am using DataGridView in C# for windows application. I want to align the column header as ceneter. But I am not able to find any of the property to align the header text of column. It automatically aligned left. You have any solution for this.
Regards
A AntonySP
Good Is Not Good When Better Is Expected.
|
|
|
|
|
If their is not a property already for the control then you will have to resort to either WinAPI, or text padding (adding extra spaces to manually center it).
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hello everyone,
Suppose we have a class which is derived from ServiceBase, which provides Windows Service. My question is, what is the best practices that what kind of code to put into constructor of the class, and what kind of code to put into OnStart method of the class?
thanks in advance,
George
|
|
|
|
|
|
Cool, Thanks Mark!
regards,
George
|
|
|
|
|
Hi,
Is there a good and free .Net profiler?
Thanks
|
|
|
|
|
Hi
When you want a full fledge profiler with some extra features the I would suggest you try ANTS Profiler. However, you may try any of the following available tools:
1- NCover
2- NDepend
3- ANTS Profiler
4- .NET Memory Profiler
5- AQtime .NET Edition 2 - Automated Profiling and Debugging
6- Compuware DevPartner Studio Professional Edition
7- Compuware DevPartner Profiler
8- Allocation Profiler
9- CoverageEye.NET
10- NProf
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
|
|
Hello everyone,
For the following code, it is correct to say that,
1. obj1 will be instialized when .NET Runtime loads class Foo and before any instance is created?
2. obj2 will be created each time we create an instance of Foo, and obj2 will be called before constructor?
My question is whether my understanding (1) and (2) are correct?
class Foo
{
static private object obj1 = new object();
private object obj2 = new object();
public Foo()
{
}
}
thanks in advance,
George
|
|
|
|
|
Yeah, I believe so. You can write your own classes in place of the objects, and check it for yourself.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Cool, Christian!
Question answered.
regards,
George
|
|
|
|
|
George_George wrote: 1. obj1 will be instialized when .NET Runtime loads class Foo and before any instance is created?
No. The obj1 member will be initialised before any member of the Foo class is used, but not necessarily when the assembly is loaded.
George_George wrote: 2. obj2 will be created each time we create an instance of Foo, and obj2 will be called before constructor?
Yes.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Guffa,
Question answered.
regards,
George
|
|
|
|