|
|
Hi everibody
I'm trying to make a simple drag and drop of strings between 2 list (or other control wich is appropriate), but I can't succed to realize this. I looking for a tutorial, or a guide wich can explain to me how to implement this simple functionality with events. There some example on the net, and on the CodeProject website, but i can't succeded to run them properly on VS2008.
If anybody can explain me how to realize this simple drag and drog, I'll be very gratefull
best regards.
|
|
|
|
|
Tom
If you cannot follow a well laid out tutorial then I suggest changing job/course and trying something less challenging.
This one is 5 years old[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for the link : this tutorial or example or course (name it as you want) seems to be weel done, and thanks for your advice but I wasn't asking for a career manager.
best regards.
|
|
|
|
|
Hi,
can any one tell me how to Convert a hexa Decimal value(4363A00E) to decimal(in the format of 123.34567)in C#.Is there any direct function to do this?
Thanks in advance
|
|
|
|
|
Member 3057887 wrote: Convert a hexa Decimal value(4363A00E) to decimal(in the format of 123.34567)
Why would you want to convert a hex value to a float? Unless it is the hex representation of the internal value of a float?
Or are you just to lazy to tell us what you want to achieve?
Give information, including what you have tried, and you are more likely to get a helpful response.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Here you go[^]
Cheers,
Vikram. Current activities:
Films: The classic Pink Panther series
TV series: Friends, season 3
Books: Liar's Poker, by Michael Lewis. Carpe Diem.
|
|
|
|
|
you really need to see this website. www.lmgtfy.com . It's much more informative
|
|
|
|
|
String hexNumber = "4363A00E";
int i = Int32.Parse(hexNumber, System.Globalization.NumberStyles.HexNumber);
Why do you want to display it in decimal? You can't create decimal with an hexa...
|
|
|
|
|
Hi,
Thanks for replying so soon. I am doing an application involving serial Port.I am getting data from Serial Port in Hexa decimal format(for eg.436300E).I need to convert that into floating point(eg.123.34).
Thanks
|
|
|
|
|
Data from a serial port generaly comes in as a stream of bytes, and are not amenable to conversion to float directly - parse probably wont work.
I assume your data is coming from a data logger or sillyscope or similar? You will have to give more detail on the incomming data stream before anyone can help you much.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hexidecimal notation usually is always involved with integer values. To convert to a float, you'd need to convert to an integer first and then move into the floating point world.
Your hexidecimal representation, is it fixed point or floating point?
Regards,
Rob Philpott.
|
|
|
|
|
In that case what you need to do is use the BitConverter which will convert a set of bytes into another data type. To get your bytes (hopefully 4 of them) to a float you need to use ToSingle
So you'd have:
byte[] data = ...
float myFloat = BitConverter.ToSingle(data)
ToSingle also takes a second parameter (all of the functions in BitConverter do). The second parameter is the offset in the set of bytes where your float starts. That way if you had a stream you could just read all of the bytes out and then work your way through; rather than copying out 2 or 4 bytes to some other array all the time.
EDIT: You say your getting the data in hex format, I assume your just getting bytes which are usually represented as hex. If you are actually getting a string from the port then you'll need to convert that back into a set of bytes,.
My current favourite word is: Delicious!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
You may use a 'union' see [^]
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Explicit)]
struct TestUnion
{
[System.Runtime.InteropServices.FieldOffset(0)]
public UInt32 i;
[System.Runtime.InteropServices.FieldOffset(0)]
public Single s;
}
and then, for instance:
TestUnion tu = new TestUnion();
tu.i = UInt32.Parse("4363A00E", System.Globalization.NumberStyles.HexNumber);
Single s = tu.s;
However it gives 227.625214 as result (are you sure about the expected output?).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
any one knows that F#?
I want to know that there is already IDE for F#? or when it will be integrated with Visual studio? or already?
thanks
|
|
|
|
|
Try Googleing 'F#' and theres all the information you need.
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
|
This is VERY close to a repost!
Why didn't you edit the original post or add a reply to yourself asking the exra information?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
This is because people tend not to answer TOO MANY QUESTIONS IN ONE POST
dev
|
|
|
|
|
If you'd WAIT for an answer, it wouldn't be so noticable that you are double posting.
I've seen three questions from you inside one page. This is indicative of not actually trying anything and resorting to others before looking yourself first.
Make that SIX questions in ONE day!
Care to explain that?
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
it's NOT double post, get a grip mate. if you're trying to help, help. If not, go away.
dev
|
|
|
|
|
devvvy wrote: mate
I don't think so.
Can you try and WAIT or is that too difficult a concept?
There is a chance, however slim, that you may understand an answer. Extrapolation of that theory gives the concept of having been helped, the next problem becomes surmountable. So you should be getting /a grip/ and behaving.
Simple concept is to ask a question and wait for it to be answered.
Adding another question after two minutes shows, as previously stated, that you cannot be bothered to TRY first.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
mate, you're execellent, i suggest you stop littering the forum, lock yourself in a room with no internet connection and you can nag all you like day and night
dev
|
|
|
|
|
devvvy wrote: nag all you like
That's what I am payed to do.
Now, do you UNDERSTAND anything I've said? No you don't
0. The OP was regarding caspol and if you'd waited for an answer the chances are good that the help would have prevented the sencond posting.
1. You were not worried about multiple questions here[^].
2. I really can't be bothered - FOAD
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
you are worried? no you're just a kiss arse littering our board in name of great good.
dev
|
|
|
|