|
If this has already been addressed, just point me in the right direction, please.
I'm trying to make an automatic wallpaper changer (using that user32.dll api that everyone uses, although there are differences among the parameters they choose). What I've done works fine on a PC at work, but it won't work on my Inspiron e1505. I understand it not wanting to display anything but a bitmap, but it didn't even want to display bitmaps on the laptop. Does it have to do with my Inspiron's odd-sized display or something (it's wider than normal displays)? Any ideas?
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Can you post your code? We're otherwise in the dark.
|
|
|
|
|
I guess the modifications I did to it (while using a work PC... yeah, I know, but I wasn't on the clock) did the trick. Now it works just fine. I was saving images using myBitmap.Save(string filename) when I should have been using myBitmap.Save(string filename, ImageFormat.Bmp). I don't know why that would make a difference, but it did. It still doesn't answer the question of why it wasn't displaying images that were originally bitmaps, but, hey, it works now. Thanks anyway!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
hi
so my problem is already explained in the subject, i can't seem to be able to embed an icon in my application and then specify it as a shortcut icon for example for the user's desktop.
in fact the only way i found, to choose an icon for the shortcut is to add an .ico file to the main project but this is not good at all because i don't want users to be able to see a separate .ico file in my program insatllation folder.
i guess there's a trick to do it but i didn't find any help on that
thx in advance
C# is the future
|
|
|
|
|
no one knows how to do that !?
C# is the future
|
|
|
|
|
Hi,
I have a dictionary of Terrain objects in a game I'm working on. Here's the class that holds a single Terrain (I didn't include the properties for brevity, but they map directly to the fields):
<code>
public cass Terrain
{
private string name;
private string description;
private List<string> tiles;
private bool blocks = false;
public Terrain ()
{
this.tiles = new List<string> ();
}
}
</code>
Another quick question: would that class be a good candidate for a struct?
I have another class TerrainManager that has a Dictionary<string,Terrain> of these.
I did have code like this to create a terrain and add it to the TerrainManager:
<code>
Terrain terrain = new Terrain ()
terrain.Name = "Grass";
terrain.Description = "The green stuff.";
terrain.Tiles.Add ("grass");
terrains.Add ("grass", terrain);
</code>
That'd be fine if there were going to be just a few, but there will likely be hundreds. So I decided this might be a good excuse to learn a bit about XML. Also this way I don't have to recompile to make a change. Here's a sample of the XML format I decided upon:
<terrains>
<terrain key="grass">
<name>Grass</name>
<description>The green stuff.</description>
<tile>grass</tile>
</terrain>
<terrain key="tree">
<name>Tree</name>
<description>They're big.</description>
<tile>grass</tile>
<tile>tree</tile>
<blocks>true</blocks>
</terrain>
</terrains>
As you can see the <blocks> element is optional and there may be one or more <tile> elements. The key attribute in the <terrain> element is the key used in the dictionary.
I got it to work using XmlTextReader. So I guess I should be happy, but I'm not, because I'm not sure it'll handle all situations gracefully and the code is a bit hard to understand after a day after writing it.
This seems like a simple thing to do. I've read about Serializable objects and thought this might help me, but those tutorials only focus on writing XML from the objects, but I don't need to write XML. I only need to read it in once the program starts and fill the Dictionary<TKey,TValue> in my TerrainManager.
I just want to do this in the simplest way possible. I'm sorry if this post was long it's my first post here. Also I'd be happy to post the code I'm currently using the load the Xml. Thanks everybody, I've enjoyed reading the articles here since starting my journey in C# and .NET.
Also I should mention I'm using Mono on Linux, but I don't think that should matter too much.
--
Mark A. Nicolosi
|
|
|
|
|
Hi Mark.
I think the simplest way to do this would be to use XmlSerializer [^]class. Using this class, you just mark your class with the [Serializable] attribute, then when you want to save your object:
XmlSerializer serializer = new XmlSerializer(typeof(Terrain));
serializer.Serialize(someFileStream, myTerrainInstance);
And when you want to load a saved terrain object:
FileStream terrainFile = ...;
Terrain myTerrainInstaince = (Terrain)serializer.Deserialize(terrainFile);
|
|
|
|
|
I'm also a great fan of the XmlSerializer but according to a discussion I recently had in the XML forum it does not support the IDictionary interface. Therefore instances of the Dictionary though marked as Serializable cannot be used with the XmlSerializer .
"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
|
|
|
|
|
Stefan Troschuetz wrote: it does not support the IDictionary interface
You're right, however, there are workarounds[^].
|
|
|
|
|
Thanks for the link. I'll bookmark that one
"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 Juda, I'll give that a try. I think this is exactly what I'm looking for.
--
Mark A. Nicolosi
|
|
|
|
|
Hi all,
i'm working on CheckedListBox, where in which i am using itemCheck event To capture the checked and unchecked values of checkboxes of CheckedListBox,
But here if Am loading some values
|
|
|
|
|
The common thing to do is to set a flag that tells you to ignore the event, within the event itself. If it's on page load tho, you could just hook up the event handler AFTER setting your values.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ya i've taken a flag, saying for the first time[when count is zero] i have restricted my itemCheck event code,
but its not working
int count=0;
if (count != 0)
{
if (e.NewValue == CheckState.Unchecked)
{
lstChcked.Items.Remove(chklstMultipleMdfyTbl.SelectedItem.ToString());
}
else if (e.NewValue == CheckState.Checked)
{
//ChklbxAdd= Convert.ToString(chklstMultipleMdfyTbl.CheckedItems.Count);
// string[] ChklbxFill = new string[chklstMultipleMdfyTbl.CheckedItems.Count];
lstChcked.Items.Add(chklstMultipleMdfyTbl.SelectedItem.ToString());
}
}
else
{
MessageBox.Show("try to restrict this event");
}
}
I DIDN't Understand ur last line,
***you could just hook up the event handler AFTER setting your values.**
reply please
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
pashitech wrote: I DIDN't Understand ur last line,
***you could just hook up the event handler AFTER setting your values.**
It's the same thing I'm telling you over and over again.
BTW, your count flag cannot work since you obviously defined it inside the event handler, so it will always have the same value (0) when execution reaches the if statement. The flag has to be an instance field that preserves its value between subsequent executions of the event handler. Furthermore, it would be sufficient to use a boolean instead of an int.
"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
|
|
|
|
|
Thnx alot, and i am done with it,
ya i've used bool and used in pageload event.
at last,1 morre,
do u know any alternate method, to deselect all the checked values of Checkedlistbox.
for (int i = 0; i < CHECKEDLISTBOX1.Items.Count; ++i)
{
CHECKEDLISTBOX.SetItemChecked(i, false);
}
if i use this, the total days work is vanishing--i mean the rest of the code that u've helped me is not working,
anyway thnx alot for ur help,
bye byes
prashanth,
|
|
|
|
|
hi all,
how to create setup file for a windows application so that user can uninstall the application without going to control panel that he should get a sub menu in all programs menu along with menu to launch the application.
thanks and regards,
praveen
|
|
|
|
|
In Visual Studio, add a Setup project. Click on the setup project's file system editor. Right-click, add special folder-> users start menu. There, add a shortcut to the uninstaller.
|
|
|
|
|
I am trying to create a TabPage as separate object. I can edit them iside s tab control allright, however, I can't create or edit the control layout of a separate TabPage.
When I create a user control (or a form), and change the base class to "TabPage", the editor changes to a generic controll collection.
What can I do?
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers! We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP Linkify!|Fold With Us!
|
|
|
|
|
I don't think there is a Visual Studio designer that allows you to layout tab pages visually. If you really need this, I think you're going to have to create your layout as a custom control, then add that to the tab page at design time.
|
|
|
|
|
This actually was easier than I thought - thanks!
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers! We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP Linkify!|Fold With Us!
|
|
|
|
|
WHEN I WRITE CODE, visual studio.net unexpectactly closes, and restart itself, i get the following errors.
OSK.EXE title
System Failed to initialize
and the second Error is VCSPAWN.EXE TITLE
APPLICATION FAILED TO INITIALIZE
I HAD A CODE THAT CONNECT TO SQL7 DB, IT CONNECT VERY WELL AND DISPLAY THE CONTENTS OF MY TABLE, BUT AFTER THAT IT ATTEMPT TO SHUTDOWN. I HAVE SCREEN SHOTS OF THE OCCURANCE, BUT I DONT SEE AN OPTION TO ATTACH IN HERE SO YOU CAN SEE, PLEASE PROVIDE ME WITH YOU E-MAIL I WILL ATTACH IT. THANKS
NOTE:THIS HAPPEN AFTER I FORMAT THE PARTITION, AND I FIRST INSTALL VISUAL STUDIO 2003.
PLEASE HELP
Vuyiswa
|
|
|
|
|
WRITING IN ALL CAPS IS JUST ANNOYING AND WONT MAKE ANYONE HELP!
*ahem*
Anyway did you bother searching? It takes less time to open up google and search for something than it does to post on here ...
http://www.google.co.uk/search?hl=en&q=vcspawn.exe&meta=[^]
Now repeat after me: "I will always search before posting multiple times in a forum and in caps"
Edit: spelling X(
|
|
|
|
|
I was searching for how windows detect MMC or SD or Flash disk and bring up a dialog that gives you options to open folder or in windows media player..etc. ...
I want to build application that make the same...
I had made an application that detect any change in disks generally but for example ( I'm intereted in MMC ) my application can detect the memory reader when it's plugged or unplugged but when I insert a memory stick in the reader it doesnot detect any change ...should I make timer that watch the memory reader all the time!! I think it's not good way..so any one has any solution for this??? and this dialog that windows brings up is from shell32.dll so any one knows how to know the function and its parameters??
thanks in advance
|
|
|
|
|
|