Click here to Skip to main content
16,005,734 members
Home / Discussions / C#
   

C#

 
GeneralOpen a Word/Excel document without saving! Pin
fatihsen9-May-05 22:01
fatihsen9-May-05 22:01 
Generala problem with DataGrid Pin
inew9-May-05 20:58
inew9-May-05 20:58 
GeneralRe: a problem with DataGrid Pin
esjq9-May-05 23:47
esjq9-May-05 23:47 
GeneralPassing a listbox to a method. Pin
Anonymous9-May-05 19:58
Anonymous9-May-05 19:58 
GeneralRe: Passing a listbox to a method. Pin
Heath Stewart9-May-05 21:21
protectorHeath Stewart9-May-05 21:21 
GeneralPowerStatus() Pin
victor_ba859-May-05 18:04
victor_ba859-May-05 18:04 
GeneralRe: PowerStatus() Pin
Christian Graus9-May-05 18:18
protectorChristian Graus9-May-05 18:18 
GeneralRe: PowerStatus() Pin
Heath Stewart9-May-05 21:29
protectorHeath Stewart9-May-05 21:29 
As Christian said, if it doesn't declare a public default constructor you can't instantiate it using the void parameter list. The PowerStatus class in .NET 2.0 does declare any public constructor, actually, meaning that you can't instantiate it.

According to the documentation, you can obtain a reference to it using the static SystemInformation.PowerStatus property:
PowerStatus status = SystemInformation.PowerStatus;
Console.WriteLine("Battery life remaining: {0}",
  status.BatteryLifePercent == 255f ? "Unknown" : status.BatteryLifePercent);


This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft

[My Articles] [My Blog]
Question"Setup-Wizard-like" layout manager in C# ? Pin
erajsri9-May-05 18:02
erajsri9-May-05 18:02 
AnswerRe: "Setup-Wizard-like" layout manager in C# ? Pin
Christian Graus9-May-05 18:15
protectorChristian Graus9-May-05 18:15 
GeneralRe: "Setup-Wizard-like" layout manager in C# ? Pin
ChesterPoindexter10-May-05 2:53
professionalChesterPoindexter10-May-05 2:53 
GeneralRe: "Setup-Wizard-like" layout manager in C# ? Pin
Christian Graus10-May-05 12:53
protectorChristian Graus10-May-05 12:53 
AnswerRe: "Setup-Wizard-like" layout manager in C# ? Pin
ChesterPoindexter10-May-05 17:00
professionalChesterPoindexter10-May-05 17:00 
GeneralRe: "Setup-Wizard-like" layout manager in C# ? Pin
erajsri10-May-05 19:31
erajsri10-May-05 19:31 
GeneralReading an Xml file into a jagged array need help Pin
OnlyTaz9-May-05 17:03
OnlyTaz9-May-05 17:03 
GeneralRe: Reading an Xml file into a jagged array need help Pin
Christian Graus9-May-05 17:08
protectorChristian Graus9-May-05 17:08 
GeneralRe: Reading an Xml file into a jagged array need help Pin
OnlyTaz9-May-05 17:14
OnlyTaz9-May-05 17:14 
GeneralRe: Reading an Xml file into a jagged array need help Pin
OnlyTaz9-May-05 18:58
OnlyTaz9-May-05 18:58 
GeneralRe: Reading an Xml file into a jagged array need help Pin
Christian Graus10-May-05 12:42
protectorChristian Graus10-May-05 12:42 
GeneralAddress Filter Pin
Duong Tien Nam9-May-05 14:23
Duong Tien Nam9-May-05 14:23 
GeneralRe: Address Filter Pin
leppie9-May-05 14:34
leppie9-May-05 14:34 
GeneralRe: Address Filter Pin
Dave Kreskowiak9-May-05 17:09
mveDave Kreskowiak9-May-05 17:09 
GeneralHelp - PlaySound only plays default sound in C# Pin
Magela9-May-05 13:15
Magela9-May-05 13:15 
GeneralRe: Help - PlaySound only plays default sound in C# Pin
Christian Graus9-May-05 15:27
protectorChristian Graus9-May-05 15:27 
GeneralRe: Help - PlaySound only plays default sound in C# Pin
Heath Stewart9-May-05 21:34
protectorHeath Stewart9-May-05 21:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.