|
I hope this is an easy question:
How do i find the screen resolution in .NET?
I want to make sure that if the resolution was reduced, my program won't come up out of the visible range.
Thanks,
Steve
|
|
|
|
|
you can get the rectangle that defines the desktop boundaries with
Rectangle DTRect = Screen.GetBounds();
To get the working area (destop minus taskbar and docked windows):
Screen.GetWorkingArea(Screen.GetBounds());
Some ideas are so stupid that only an intellectual could have thought of them - George Orwell
|
|
|
|
|
Thanks. I knew it would be something obvious like "Screen". I kept trying to find a "Display" object.
-Steve
|
|
|
|
|
I'll try to keep this short
I am working on an app for which I would like the user interface to be customizeable. Not just in appearance (control location) but in terms of content as well.
I am considering have a series of DATA tables in the database that contain the content" for the application, and a METADATA table that contains a mapping for DATA fields, and form controls (including screen position, labeling, etc). The mapping capabilities will need to be 2-way, meaning a screen scrape-> persist as well as read from db -> display.
(For performance reasons, I am thinking that creating an in-memory cache of "rendered" forms for the different DATA types would be usefull. Not sure exactly how to handle this.)
Has anyone else tried something similar? Does anyone see any major "landmines" that I am about to step on?
Mike Stanbrook
mstanbrook@yahoo.com
|
|
|
|
|
Paul DiLascia made something about it, here[^]. Open Xml GUI framework.
|
|
|
|
|
THIS IS URGENT PLEASE, I POSTED EARLIER BUT NO REPLY.
I'm using the following code to send an output string to a printer but I need the printer to write it from Right to Left instead of Left to Right because otherwise it will be impossible to adjust specially with long text...
PrintFont = new Font("Tahoma", 10);
PrintDocument pd = new PrintDocument();
pd.DefaultPageSettings.PaperSize = pd.PrinterSettings.PaperSizes[(int)myRegistry.GetValue("Paper Size")];
pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
pd.Print();
Jassim
Jassim Rahma
|
|
|
|
|
I am packaging my application for distribution. One of the items I have on the To-do list is to put a shortcut in the Start menu with a particular icon.
I started an Installer project, right clicked on the project and chose View->File System. I selected the "User's Programs Menu" and created a folder. I then created a shortcut from my Application Folder/Primary output from ... and placed it in this folder.
Now comes the bit which doesn't work. I right clicked on the shortcut I had created, and selected Properties Window. This has an "Icon" item. I want to change the Icon so that it looks like my program. So I browse and select the App icon inside my Primary output file.
Build/install and I get the default icon look - not my custom icon.
Hmmm - I thought - why don't I add a .ico file with the appropriate icon in it, and point the icon at that. So I uninstall the previous version, alter the icon, build/install and I get the same default icon look.
Can someone please explain how I can make my installed shortcut have my desired icon?
-Adrian
|
|
|
|
|
I did almost the same as you, but instead of pointing at the .ico file in the project or a custom one I pointed at the .exe I was creating the shortcut to then chose the icon I wanted from the list.
That did the trick for me anyway.
James
"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Yep - thats what I did the first time (the application Icon App.ico which is embedded into the executable) - that didn't work for me.
Alternative - are there any alternate setup/installer systems out there that integrate with VS.NET IDE?
-Adrian
|
|
|
|
|
InstallShield is there but I its a differnt beast altogether, but has all the facilities you need to prepare a good installer but has a good learning curve.
Kannan
|
|
|
|
|
I want to implement the IObjectWithSite interface (and
others too, this is just a concrete example).
Did Microsoft already implemented these interfaces? I
saw that in some beta they reside in
Microsoft.Win32.Interop or something. Now it is gone.
Do I have to manually do that, use a tool, or they are
implemented somewhere?
Please help!
|
|
|
|
|
Hate to tell you this, but it's not there at all. Looks like you'll have to write it yourself.
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
IObjectWithSite is just a stupid interface with only 2 methods aimed to register yourself as a host.
You've got samples for that in many places (even in codeproject). Here are some :
- ATL : IObjectWithSiteImpl default implementation
- IE samples : bandobj, explorerbar, regview, ...
|
|
|
|
|
This particular one is really simple.
But what about IDownloadManager. It has a lot of things to implement.
There should be some namespace, some tool, or some third-party stuff about that. Right?
|
|
|
|
|
standard Workflow, here[^].
A working sample[^] (written in Delphi, but easy to understand).
|
|
|
|
|
I know about these.
Here the problem is much bigger, you have numbers of interfaces to implement to make it working.
Isn't there any tool for implementing them automatically?
|
|
|
|
|
Rincewind wrote:
Here the problem is much bigger, you have numbers of interfaces to implement to make it working.
You have been talking about the download manager, which is a simple callback mechanism. Other interfaces, such as IObjectWithSite, are interfaces that of course have to be implemented since you are building a IE host, but that's a total different story than the download manager stuff itself.
As you have probably seen from the samples I have referred to, there is a way to simplify your life as a coder by just querying the IServiceProvider services, instead of building a full fledge host. You decide.
Rincewind wrote:
any tool for implementing them automatically?
And yes, ATL provides some default implementation for a lot of these standard ActiveX interfaces.
Codeproject is often the automatical implementation for your needs.
|
|
|
|
|
Rincewind wrote:
I want to implement the IObjectWithSite interface (and
others too, this is just a concrete example).
Did Microsoft already implemented these interfaces?
In addition to Stephane's links, here is Microsoft's implementation of BaseCodeGeneratorWithSite[^] that was a public class in VS.NET 2002 but made internal in VS.NET 2003.
Some add-ins made use of this class, notably .NET CollectionGen[^].
James
"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Hello everyone,
I have been working on C# programs, my friend gave me a C++ program that is useful to me and i need to call that C++ program from my C# program. Is there a way to do that? Thanks for any help in advance
min
|
|
|
|
|
It depends on what you mean by "call".
If you mean "executed the executable", you can use the Process class to spawn out a new process.
If you mean "call into the code", look at this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp12192002.asp
|
|
|
|
|
if you Call the .exe file.You can call the API :ShellExecute().Of course,you must import the function at first.;)
|
|
|
|
|
Hello everyone,
I got this error when i try running my C# program: "Fatal out of memory error."
anyone knows how to solve this problem? Thanks alot in advance
min
|
|
|
|
|
|
my program consists of a few classes so it is quite hard to post online..
by the way, is there a way to free the memory allocated? Cos i got this error "System.OutOfMemoryException".
Thanks alot
min
|
|
|
|
|
Thanks alot for your help, i have solve the problem.. Thanks again..
|
|
|
|