|
Use File.Move (it's in System.IO).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Set labeledit property to true. Handle AfterLabelEdit event to get notified when an item gets renamed.
|
|
|
|
|
Take a look at this[^], and take your pick.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
When running the following code "stream" is null anyone see why? I'm a noob. Is there a better way to get my embedded resources out of my build?
private static void ExtractFile()
{
Assembly Assemb = Assembly.GetExecutingAssembly();
Stream stream = Assemb.GetManifestResourceStream("LockOut_NA.Properties.Resources.ECLock");
FileStream fs = new FileStream(@"c:\ECLock1.htm",FileMode.CreateNew,FileAccess.Write);
StreamReader Reader = new StreamReader(stream);
StreamWriter Writer = new StreamWriter(fs);
Writer.Write(Reader.ReadToEnd());
}
Thanks in advance.
|
|
|
|
|
I guess the string passed to GetManifestResourceStream is incorrect. Call GetManifestResourceNames to see available embedded resources.
|
|
|
|
|
This is unlikely to be related to your problem, but using a StreamReader and StreamWriter to save it as a file is bad form. What if your resource contains a zero? What you could do instead is something like this:
public static void CopyStream(Stream source, Stream destination)
{
byte[] buffer = new byte[128];
long previousSourceIndex = source.Position;
int read = source.Read(buffer, 0, buffer.Length);
while(read != 0)
{
destination.Write(buffer, 0, read);
read = source.Read(buffer, 0, buffer.Length);
}
source.Position = previousSourceIndex;
}
Pass the manifest resource stream as the source, and a FileStream as a destination. Don't forget to close the Streams properly when you've finished - a using block would be helpful
|
|
|
|
|
Hello everybody, my problem is about DMX protocol. I want to create a program wich can handle the movement of some disco ligths. I mean, I want to create a software wich can manage the movement, and if is possible some other propierties of this kind of ligths. But this ligths work with a DMX protocol, they are conected into a bus (network topology), and I don't know the propierties of DMX protocol. Please, if someone know how to handle this protocol, if someone can give me an example on C#, it will be nice.
thanks to everybody
|
|
|
|
|
I have created two UserControls to try and resolve this.
namespace libSigCntrl
{
[ToolboxBitmap(typeof(ctrlBankBitSW))]
public partial class ctrlBankBitSW : UserControl
{
public ctrlBankBitSW()
{
InitializeComponent();
}
}
}
namespace libSigCntrl
{
[ToolboxBitmap(typeof(ctrlBitSW))]
public partial class ctrlBitSW : UserControl
{
public ctrlBitSW()
{
InitializeComponent();
}
}
}
The commented lines represent other attempts.
There are bitmaps for each of the controls added to the project
libSigCtrl
-
-
- ctrlBankBitSW.bmp
- ctrlBankBitSW.cs
.
.
- ctrlBitSW.bmp
- ctrlBitSW.cs
The Bitmaps have there "Build Actions" = been set to "Embeded Resource"
The Bitmaps are 16x16 at 16 color.
The Output Type is "Class Library".
This is driving me nuts.
|
|
|
|
|
There are two scenarios, and it would be useful to know which applies, in order to try to help.
Scenario 1.
You are looking to add one of your controls to a designer in the same solution as the controls, but you have not yet explicitly added your controls to the toolbox.
Scenario 2.
You have explicitly added your controls to the toolbox, and they do not display the assigned image.
Please say which.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I don't think either. I have created a project with to two controls in the project. The project is a class library that will hold a variety of "Controls" extending UserControl... Maybe it is Scenario 1. The user controls do show up in on my solution palette but with the default cog image. Does that help Henry. If now and I will try again to clarify.
Gregg
|
|
|
|
|
I thought that this might be the case.
What you are getting is the correct behaviour.
Whilst the Library containing your controls is included in a solution, the system does not use the assigned icon. It always uses the Cog icon.
To find out if your icon assignments are working you have to manually install your controls into the Toolbox.
For the easy way to do that take a look at this[^].
The 'standard' way to do it is to right click on the toolbox, in the section where you want your controls added, select 'add items' or 'choose items' depending on version of VS. When the dialogue appears click the browse button, navigate to and select your dll and then click OK.
Before doing either of the above, you might also want to right click the toolbox and select 'Add Tab'. You can then call it 'My Controls' or whatever you like, to keep your stuff separate. If you do this, when you right-click to add the controls, make sure to right-click in your new tab, so that the controls are added there.
Hope this helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
If you can check out
www.experts-exchange.com/Programming/Languages/C_Sharp/Q_24283292.html
|
|
|
|
|
Can you declare an array of mixed Types?
I need have an array that contains: int key, form Control, form Monitor
Form [50,3] Truck
Is it possible?
Thankx
|
|
|
|
|
|
Either create an object array as Harold sugested, or create a class that holds the various types you need in it's properties and create an array of your class - this will save a lot of boxing/unboxing.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Not yet; C# 4.0 brings in Tuples, but I don't know how these would interact with arrays and it hasn't be released yet
|
|
|
|
|
hi .... everybody
who can give me example of Database + listbox with image or icon
the icon and image within listbox can be checked by people and give the result of database query
garnett
|
|
|
|
|
Make your mind up!
Are you doing this in Visual Basic or C#.
You should not post questions on more than one forum!
Naughty, naughty CPian.
Make up your mind and then delete the message that is in the wrong forum.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I can use VB.Net or C# .... just what I want
I now estimate the method
please don't post the reply answer of no help
garnett
|
|
|
|
|
wgarnett wrote: please don't post the reply answer of no help
I am posting the reply answer of help.
I am advising you on the correct behaviour on CP forums.
Now for goodness sake, decide if you want a C# answer or a VB answer and delete the one you don't want.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I just want to know C# or VB.Net method
so I post to two forum
and plz don't waste time to reply unuseful answer
I only want to know the method that how to do it
If you know the useful sample and example , plz give me the link , thanks .
garnett
|
|
|
|
|
wgarnett wrote: I just want to know C# or VB.Net method
So just post in one place and say that you don't mind if responses are in C# or VB.
wgarnett wrote: so I post to two forum
I have tried and tried to explain to you that doing so is considered rude on CP.
wgarnett wrote: and plz don't waste time to reply unuseful answer
I have all the time in the world, no problem at all.
wgarnett wrote: I only want to know the method that how to do it
You might have a better chance of getting an answer if you, explain your problem in a clearer way.
wgarnett wrote: If you know the useful sample and example , plz give me the link , thanks .
I have a link for you here[^].
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi .. man
I say I only want to know how to do it
the technology , the component or the method
If you have no useful answer for this topic
please don't waste time to reply
garnett
|
|
|
|
|
I found the answer by myself, it uses component called "listbar"
I only want the answer like this , ok ?
garnett
|
|
|
|
|
Well done.
I am pleased that you have found a solution.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|