|
Can't be done.
What you should be looking into is setting up Auto Logon. See here[^]. No code required...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
Thanks a lot..
It is working
|
|
|
|
|
I am using the following code to create a graphics object (image) which i then write text to and display on the screen. When I try to resize the object's width i get an error saying that it is read only? What does this mean and how can I resize it?
m_objDrawingSurface = new Bitmap(this.ClientRectangle.Width,
this.ClientRectangle.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
To resize it I am trying to use:
m_objDrawingSurface.Width = this.ClientRectangle.Width;
Im trying to resize the image to match the window size when it changes.
Could someone please help to correctly change the size??
|
|
|
|
|
The property is indeed read only - a Bitmap does not allow you to change that sort of thing. You need to create a new Bitmap, use Graphics.FromImage to get a graphics object, and then draw your bitmap into the graphics object at the dimensions you want to convert it to. Bitmap.Clone also has a method that takes a size, but the size needs to be smaller, and it makes a copy of part of the image, it does not resize.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hey,
I want to write a peice of code which can be useful to shut down my computer from C# programmer. I want to call executable responsible for shutting down computer is it possible?
|
|
|
|
|
There are API calls that do this, which you can import into C# and call. The .NET framework has nothing to do this for you. I googled for more info ( my code to do this is at home ), and this is the first link I found:
http://www.codeproject.com/csharp/timercomputershutdown.asp[^]
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You can use the following which is actually a shell command:
System.Diagnostic.Process.Start("shutdown","/s")
For a different tactic, take a look here[^].
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Yes, it's possible! I had the same problem a month ago
Go to http://www.mentalis.org/soft/class.qpx?id=7 download WindowsControler. To shutdown your computer you need to add WindowsController.cs to your project, add line "using Org.Mentalis.Utilities;" ....... and
WindowsController.ExitWindows(RestartOptions.ShutDown, true);
Best regards
|
|
|
|
|
can any body tell me "in very simple words" that what are the indexers. i am a just a beginner to c#. so please use very easy language.
i am athar
|
|
|
|
|
Well, I guess one could say that Indexers are just a way of allowing your Class to be used and accessed just like an array. No wonder why they are also called "virtual arrays". For a rather self-explanatory tutorial take a look here[^].
Hope this helps you get the overall picture.
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
You can imagine indexers to be like overloading [] operator in C++. They essentially allow you to treate your object like an array.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
I'd like to create user controls like I'm used to in windows forms
is it possible or should I use something else?
I'd like to re-use my basic IU with menu buttons and load misc. lists or status usercontrols into a placeholder..
thanks,
H
|
|
|
|
|
So what you are actually saying is that you need a good tutorial what will help you with your first user control? If this is the case, take a look here[^].
Hope this helps.
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Well, yes.. it does.. a little..
Is it possible to make a user control, visually, like the ones in Windows Forms ?
For my PocketPC app..
|
|
|
|
|
Ooops, I am sorry. I didn't notice it was for a pocket pc application. Take a look at the following links then. They are specific to the .NET Compact Framework:
Link 1[^]
Link 2[^]
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Has anybody managed to get IIS hosted .NET remoting to work on a virtual server? I'm dammned if I can get anything other than a 404 from a remoting endpoint I know works otherwise. Have tried setting the machinename attribute in the channel configuration, but to no avail.
Anyone got any ideas?
Ryan
|
|
|
|
|
i want to know how to go to a different 'room'.
Eg. In an rpg, you walk through a door of a building and you go to a different 'room' (the inside of the building)
or in a game like sonic, you move to the next 'room' (the next level).
Any ideas on how to do this.
(i do not need any help on collision checking or anything, just how to redraw the entire room to the new one)
Thanks i advance, i know i'll get some help here
|
|
|
|
|
The way that these things generally work is that you have an array of structures that represent your 'rooms', and each room 'knows' what other room in the array a door points to. Then you just change the room you're pointing at in the array, and call a generic function that draws it, and so to the code to interact with it uses this structure to know what's there.
That's assuming you go to the edge of the screen and walk into another room. If you are always scrolling, then you need one big map.
The idea really is to write generic code that knows how to interact with *everything*, code that knows how to draw *any* room, then use a data structure to change what room you're interacting with. This is also why it's so easy to provide a map editor with most games. It just edits that structure.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You can simply make a class or method that called Room() ,
This method or class ,whatever,will draw the default room that will be used in all the room ,and then just make a method named Room1(),Room2(),Room3(),etc... , and these method will contain the additionla data for it's room ,
Maybe Room1() will contain one person ,but two contains two animals ,so the default room will help you in this.
|
|
|
|
|
Hey i want to get an image from scanner in C# and then display it in the picture box cna any one help me give me code of it i found code of it in
other languages but not in c sharp so plz give me the code ok tc bbaye !
Sohail....
|
|
|
|
|
Recently, I've heard here a post something like this one:
"We can help you with your code, we can try to correct it. But we'll not give you any code just because you asked for it". In other words - We can't help you, if you do not wish any help.
The topic of getting image from scanner was already discussed here some times. Try to search here or use google.
|
|
|
|
|
I concur with Andrew. If you have code already in another language, then converting it to C# will help you greatly as you will have to understand how it works which will give you a greater understanding of your problem area.
Of course, if you are stuck with converting a section of the code then we are always here to help you get over the bumps and out of the potholes you might find along the road.
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
TWAIN is a pretty in depth subject. There is a C# TWAIN implimentation here on CP, I am pretty sure. If not, perhaps you should write one and offer it here
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Actually i have code of twain in C sharp but it is copy right ......thats the problem.....and also have code of geting image from scanner...in vc and vb when i make a dll file and try to add reerence of it and add it in C#.net its giving invalid com something like this eroor so tell me how to convert it in c sharp ok tc bbaye
|
|
|
|
|
How do you convert it to C# ? One line at a time. Seriously, that's not a question I can answer, it's simply too broad, esp. when I can't see the code in question ( no, please don't send it to me ).
How did you get code that is copyrighted ?
Christian Graus - Microsoft MVP - C++
|
|
|
|