|
|
Doesn't have to be, valid types are void and int according to the C# spec I seem to remember, same as in ANSI C
Ed
|
|
|
|
|
|
Ravi Bhavnani wrote: Isn't Main() a void method?
Main() can be either void or int :
[STAThread]
static int Main(string[] args)
{
if (error)
return 1;
else
return 0;
}
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Ravi,
Yes, your code works perfectly. Thanks!
This code works also:
Application.Exit();
Environment.Exit(2445);
Thanks,
Mark
|
|
|
|
|
Thanks, but I think you meant to thank Braulio.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
|
Hi,
When loading a program how do i check if an instance of the same program is already runing, and if so maximizing it from the system tray instead of opening a new instance?
tnx
Roy
|
|
|
|
|
Search the articles here on Code Project. There are many that cover this topic.
www.troschuetz.de
|
|
|
|
|
Hi, I get a window crash on executing the following code. Problem tracked on sending the message RB_SIZETORECT. Please let me know if there is any solution for this and anybody faced same problem. Thanks ..
Win32Wrapper.RECT rbWindowRect = new Win32Wrapper.RECT();
Win32Wrapper.GetWindowRect(m_ReBarWindowHandle, out rbWindowRect);
int height = Win32Wrapper.SendMessage(
m_ReBarWindowHandle, Win32Wrapper.RB_GETROWHEIGHT, 0, 0);
Win32Wrapper.RECT insetRect = new Win32Wrapper.RECT();
insetRect.Left = rbWindowRect.Left;
insetRect.Top = rbWindowRect.Top;
insetRect.Right = rbWindowRect.Right;
insetRect.Bottom = (rbWindowRect.Top + height);
Win32Wrapper.SendMessage(
m_ReBarWindowHandle,
Win32Wrapper.RB_SIZETORECT,
0,
ref insetRect);
test test
|
|
|
|
|
Hello,
When you build a custom control and place it on the toolbar in the VS IDE, then add it to a form, the public properties are dynamically loaded for that control/class in the properties window, right? I want to replicate that functionality in a test application.
Basically I'm building a class library that serializes/deserializes classes into/from XML documents on a network stream (through a socket.) As the serialized objects come down the wire and are deserialized into objects, they are sent to the (Windows) UI through events. I want to store them into something like a ListView (using a derived class from ListViewItem that holds a reference to the object) then when I click on an item in the ListView, a properties window is displayed showing all the public properties of that object along with the values. Then I can make sure that the objects are being serialized/deserialized correctly.
Any ideas how would I do this?
Thanks
|
|
|
|
|
You can achieve this by using reflection. The following lines of code should point you in the right direction.
PropertyInfo[] propertyInfos = obj.GetType().GetProperties();
for (int index = 0; index < propertyInfos.Length; index++)
{
propertyInfos[index].Name;
propertyInfos[index].GetValue(obj);
}
www.troschuetz.de
|
|
|
|
|
That't great! Thank you very much
|
|
|
|
|
You can use a propertygrid to display the properties of the class.
You can make changes to the object through the propertygrid though.
|
|
|
|
|
I have an alarm application for a Pocket PC (DELL Axim x51). When the alarm ring I play a beep sound using soundplayer class's PlayLooping method. But the sound stops on touch of any part of screen. I should play the sound until the user hits the STOP/SNOOZE menu buttons(which I have in my application). I display a messagebox when it starts playing. please suggest me how to keep the sound playing until the user hits my menu buttons. I do stop it in menu's event handler but before that when the user clicks on the screen it stops. I need to prevent this from happening and should make the sound stop only on click of my menu items.
--Shobha
-- modified at 10:56 Monday 3rd April, 2006
I have forgot to mention that I'm using OPENNETCF's Soundplayer class and my project is on Visual Studio.NET 2003.
|
|
|
|
|
Hi
I got an .png Image and want to convert it in an .gif file. When i try to show the .png file in an img tag the backround color of the image is grey. I heard Inetrnet Explorer can't show transparent .png files.
So i want to convert it in an .gif file. But after that the background of my .gif file is black..
<br />
String gifFilePath2 = System.IO.Path.Combine(path, fileName + "_scaled.png");<br />
String gifFilePath3 = System.IO.Path.Combine(path, fileName + "_scaled.gif");<br />
<br />
System.Drawing.Image imgGIF = System.Drawing.Image.FromFile(gifFilePath2);<br />
Bitmap bmpGIF = new Bitmap(imgGIF, size);<br />
bmpGIF.Save(gifFilePath3, System.Drawing.Imaging.ImageFormat.Gif);<br />
|
|
|
|
|
How to get: selected or not selected some text or images on page of axWebBrowser? It is for work with clipboard.
|
|
|
|
|
Can you make your question more structured please....
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
It is for different popup menu. If text selected i show popup_memu_1. If text not selected i show popup_menu_2.
-- modified at 15:29 Monday 3rd April, 2006
|
|
|
|
|
Hello
I have a checkbox I set to Enabled =False from time to time. However, I don't appreciate the grey tone both text and box gets when this is done. Is there some way to work around this? So far I've done an inherited checkbox control which actually consists of two, one of which is always disabled. I move this to front when control.Enabled = false. This doesnt solve the problem with the actual box being grey'ed down as well. How should I go about doing this?
/regards
|
|
|
|
|
I don't have the time to investigate this in detail.
But here is one idea:
You could owerride the Paint method from your derived checkbox and draw the checkbox by yourself.
But I would like to point out that checkboxes are supose to be gray when they are disabled. That's just standard practise and you should have a really good reason for not folowwing that...
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I think setting AutoCheck to false will draw it like it was enabled but will not automatically change the check state when the user clicks on it.
|
|
|
|
|
thanks for your suggestions
|
|
|
|
|
Hello!
I'm looking for a function which I can give a file path and a number of pixels. The function should remove enough characters of the path and replace them by "..." to fit into the given amount of pixels.
The PathCompactPath Win32 API function does this, but is there also a managed equivalent in the .NET framework?
Thanks and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
If you're drawing your text using GDI+, you can use StringFormat class and set Trimming to EllipsisCharacter.
If you need it in a control, you can easily create custom control that does all the drawing and uses appropriate Trimming flag.
|
|
|
|