|
1.) Yes it has to a bitmap and Windows converts pictures with another format into a bitmap before it sets them as wallpaper.
2.) AFAIK there isn't.
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks very much for the information.
- Aaron
|
|
|
|
|
I have an object class I need to compare for equality, but for which the greater/less than returns that IComparable uses to implement sorting are meaningless. Is there an interface that supports this comparison, or do I have to choose between abusing an existing one and rolling my own?
|
|
|
|
|
Unless you actually need to implement a specific interface, you could just override the == and != operators and the Equals method.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks. I was overthinking the problem.
|
|
|
|
|
How can I protect my app in my computer ?
What I mean that how can I start my program
ONLY in my computer.
If someone else try to start the program in another
computer it will not start.
how can I know the unique id of my harddisk ??
and read it from my app .... ?
|
|
|
|
|
Use the network MAC address :-
ManagementClass oMClass = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection colMObj = oMClass.GetInstances();
string macAddress = "";
foreach (ManagementObject objMO in colMObj)
{
if (objMO["MacAddress"] != null)
{
macAddress = objMO["MacAddress"].ToString();
break;
}
}
Is there a better, quicker way to get this anybody?
Regards
Malc
*********************************************
|
|
|
|
|
Mac addresses are changable. CPU(?)/mobo serials would be a better bet. You'll need to use WMI to get that sort of information.
|
|
|
|
|
Is there some reason the XML serializer doesn't support serializing a property whose type is an interface?
Is there some workaround to that, given that I WANT to serialize the property? A work around other than making an abstract class and using XmlInclude?
I don't know the concrete types to serialize, since the object I want to serialize can be defined in a different assembly, and I'd end up with a circular reference. Plus, I don't want to entangle the general purpose class I already have with application-specific implementations of objects that need to be serialized, hence the interface to begin with!
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Marc Clifton wrote: Is there some reason the XML serializer doesn't support serializing a property whose type is an interface?
what is there to serialize? Generaly you serialize "data", an interface contains no data.
If you want the data resulting from some method of the interface to be serialized then you need to represent that as a property where the type would be like "string" or whatever. Then the implementation of the property would call the method of the interface to produce the data.
led mike
|
|
|
|
|
led mike wrote: Generaly you serialize "data", an interface contains no data.
Xml serialization supports serializing objects, not just value types, building an object graph. In this case, the interface is implemented by some classes that I want serialized. Why the serializer can't simply output the type information is beyond me.
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Marc Clifton wrote: Xml serialization supports serializing objects
Well I hate to point out the obvious but an interface is not a concrete object. Another approach could be custom serialization. Not very difficult.
led mike
|
|
|
|
|
Hi,
first of all the serialization mechanisms of .NET don't serialize properties - they serialize fields. This is important because not everything which determines the state of an object is accessible via its public interface. Are you getting some kind of exception? If the property encapsulates a field it should work as long as the concrete class hanging in this field is marked with [Serializable].
Robert
|
|
|
|
|
Hi
i devlope a application in which i used a lot of png image files.i place the image folder ,where the exe is,.
this is also working in release mode .but whenever i place .exe file to desktop it demand for image folder.
i have to put image folder to destop.
How can i escape of putting the image folder to desktop.
Can i place all image file to solution explorer then what the path would if this time path is
btn_select_folder.BackgroundImage=System.Drawing.Image.FromFile(Application.StartupPath+@"\dbxpngs\002.png");
plase tell some solution
parshant
|
|
|
|
|
Why do you put the program on the desktop? Put a shortcut to the program on the desktop.
---
b { font-weight: normal; }
|
|
|
|
|
I don't know, but it seems the crystal reports doesn't like me or my computer or something, because I can't get the following simple scenario to work:
- I used strongly typed datasets in the application to build my model with
- I Added a couple of forms and used databinding to connect the datasets
This all works fine, so I created a crystal report to print some of the data.
It's a report with a parent child-relation in it, because I'm showing a delivery note with delivery items on it. I used the wizard, so I can assume that works out.
But when I run the app and try to print something using the report, I get an empty report from my printer. After two hours of searching and finding it out myself, I'm out of options.
The code to load and print the report is as follows:
Pakbon report = new Pakbon();<br />
<br />
report.SetDataSource(ds);<br />
report.PrintToPrinter(1, true, 0, 0);
WM.
What about weapons of mass-construction?
|
|
|
|
|
A short update on the problem.
I thought it had something to do with me using multiple related tables, but I was wrong. After trying one more time, this time with a single table for the report head and a single table for the report details, that didn't work out.
WM.
What about weapons of mass-construction?
|
|
|
|
|
Its weird, but I solved it. Crystal report doesn't seem to eat more than one table per report. So I created a view which merges the data from the different tables and used that in the report.
Now everything is fine and my shipping items are showing up in the subreport, but I still think it's weird that it isn't possible to use more than one table in the report.
WM.
What about weapons of mass-construction?
|
|
|
|
|
string str = (string)value;
int i = str.IndexOf(".");
str.Remove(i, 1);
|
|
|
|
|
Because its not assigned to anything
I'm still thinking like a 'C' prgrammer.
Doh!
|
|
|
|
|
Remember strings in C# are immutable, so you need something like str = str.Remove(i, 1) if you want to modify a string.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
It works just fine, it even creates the string that you want. It's only that you don't keep the reference to the string, so it floats around in heap limbo until it gets garbage collected.
So close...
---
b { font-weight: normal; }
|
|
|
|
|
How would i go about assigning the F12 key to focus on a textbox within a form? Meaning when a form is active, if the f12 key is pressed (doesn't matter which component is active) the focus will be set to a certain textbox.
I know how to set the event when a certain component is active, but if i want to set a global keyup event, how would i do so?
Here is the code for a textbox keyup:
this.textBox_units.KeyUp += new System.Windows.Forms.KeyEventHandler this.textBox_units_EnterKeyPressed);
private void textBox_units_EnterKeyPressed(object sender, System.Windows.Forms.KeyEventArgs e )
{
if(( e.KeyCode == Keys.Enter ) || ( e.KeyCode == Keys.Return ))
{
this.textBox_upc.Focus();
}
}
|
|
|
|
|
Register to the KeyUp event of your form and set its KeyPreview property true .
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
works like a charm
thanks
|
|
|
|