|
You are thinking in hexadecimal, which is your problem. Hexadecimal is just a textual representation of numbers, but you don't want to send text.
14643 is<br />
0011100100110011 in binary 16 bits<br />
00111001 00110011 as two 8 bit values<br />
57 51 in decimal
A 16 bit value can be represented in little-endian or big-endian format. Intel system uses little-endian format, so you send the least significant byte first.
So, first you send the byte value 51, then the byte value 57.
You can use the BitConverter class to split the 16 bit value into two bytes:
Dim checksum As Int16 = 14643<br />
Dim bytes As Byte() = BitConverter.GetBytes(checksum)
You now have an array that contains two bytes, 51 and 57.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Hi Cory,
once more you confused me:
in an earlier post[^] you asked for converting a string into a byte array holding the ASCII
characters, indicating you want to send text (but you needed the byte array so you could
insert non-printable characters such as hex 01, 02 and 03 IIRC).
Now you get two completely different replies on your checksum question; mine is
generating a hex string (which would need to go through the string-to-bytearray process),
Guffa's is generating two bytes that are not ASCII characters at all (and at a specific
byte order you never specified as far as I can remember).
So I don't see how this all fits together.
If this still is about the thing that started as a CRC-16 question, you are taking a long
and scenic route through the binary/text and decimal/binary/hex worlds.
It might be a good idea for you to publish a couple of complete, valid messages (e.g.
using hex byte values) with indications what is what; doing so would help us understand
what your questions are about, and how they fit in the overall scheme of things.
It's just a thought.
Greetings
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi,
Is there is any way to add a listview in datagrid like nested datagrid?
I want a main datagrid with +/- button to expand and collapse the item.Now I want to add a listview within the datagrid.
Thanks In Advanc
Ejaz
|
|
|
|
|
I have done nested datagrids before. If you google it you should find several topics on it. However, I think most of the code is C#.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Hi,
I have a confusion regarding storage of instances in VB.net . I am dynnamically creating pictureboxes in response to a user click at runtime. I am then adding them to 2 different ArrayLists (as i need to use them while maintaining 2 different orders). Now would this create 1 instance of the object in memory or waste resources by creating 3 different pictureboxes? If it will, then whats the way to store a reference as you can in C++ using the & operator?
Thanks,
Ahmad
|
|
|
|
|
This will only create one object in memory. Both arrays can then point to the same instance.
Dim pic As New PictureBox()
With pic
. ' setup the picture box
End With
Me.Controls.Add(pic)
MyList1.Add(pic)
MyList2.Add(pic)
|
|
|
|
|
hi all,
i want to Modify a AVI file. i want to add some Text with AVI file but i dont know from where i start this thing?
can anybody guide me or Provide me some link about modify an existing AVI file
any help will be grately appreciated.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Text? If you're trying to add captions, free programs from download.com will do the same thing without the work. Otherwise, I suggest you start with the XVID source...
|
|
|
|
|
Hi,
I want to design an Mdi application but with a transparent background for the MdiClient container (and form). It should behave in a similar fashion to the way "Mathematica" behaves if you know that software.
I have two screens. I want various child forms to be scattered across both screens but at the same time windows from a different application must be visible, and respond to mouse events, in screen areas where there are no child forms. Put it another way the MdiClient container must fill both screens but be transparent.
The problem is that the class MdiClient in non inheritable and I can not override the appropriate method to not color the background. Setting transparentkey in the main form to some color and setting the MdiClient background to this color doesn't work either, the MdiClient control doesn't support transparent background colors.
If you have a different idea how I can achieve this functionality that's fine by me. My desire is simply to able to use my screens working area with maximum efficiency and at the same time have the sub forms behave as child forms of a single application.
Any help will be most appreciated,
Gary
|
|
|
|
|
I'm not sure but I think the mdiform overrides his color property and sets it back to the default color.
I veagly remember trying something like this a few years ago and if I remember correctly I was able to change the color in code.
So perhaps you need to set the transparenty color and color of the mdiclient container in code
|
|
|
|
|
Nah,
using this line of code:
mdiclient1.BackColor = Color.Transparent
Generates the following exception:
"Control does not support transparent background colors"
But it works fine for any other color.
|
|
|
|
|
then try the following
mdiclient1.transparencykey = color.white
mdiclient1.backcolor = color.white
I'm not sure what will happen. I think you mdi container will just disapear unless there is a form in it which doesn't have its backcolor set to white (once again it's been a few years since I experimented with it so it's a bit vage)
|
|
|
|
|
You can't do what you want. The MdiClient container does not support a Transparent background, nor does the form hosting it.
It can probably be done. You'll have to create your own Form class to support this stuff, complete with how to setup your own window and custom drawing code to show it. You'd better have a thorough knowledge of how Window's windows work, especially Layered Windows. And you'll have to do a bunch of trial-and-error work to get it correct. You're treading in undocumented territory, so you won't be getting much, if any, help on exactly how to pull this off. I hope you can do your own research.
|
|
|
|
|
Well, I know for sure it has been done.
I got the inspiration for this from "Mathematica".
But no, there's no way I can pull this off myself, I don't have the knowledge.
I will find a way to work around this.
Thanks
|
|
|
|
|
Mathematica doesn't use Windows Forms. It uses custom coded windows that do NOT have the weight of the .NET Framework Form class on top of it.
It's kind of like making your own chocalate chip cookies from scratch. You know, grinding the flour yourself, making the chocolate chips, raising chickens to lay the eggs you need, ... And then there's the .NET Framework Form class, where you just pull a ready-made cookie out of a bag.
|
|
|
|
|
I know.
Kudos on the cookie analogy.;)
|
|
|
|
|
I've got a textbox that updates with some information when an event fires. The textbox multiline value is set to true.
A message is appended to a new line in the textbox.
But if the number of lines exceeds the size of the control, the vertical scroll bar appears, but it stays at the top position. It wont automatically scroll down to the last entry.
I've been trying:
TextBox1.Text = TextBox1.Text & vbCrLf & Message<br />
TextBox1.SelectionStart = TextBox1.Text.Length<br />
or
TextBox1.Text = TextBox1.Text & vbCrLf & Message<br />
TextBox1.Select (TextBox1.Text.Length, 0)<br />
But no luck.
Any ideas?
|
|
|
|
|
Hi, when the caret is present, you can make the line containing it visible with
TextBoxBase.ScrollToCaret()
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I want to remove Close button only , not system menu & minimize/maximize buttons
Thanks
|
|
|
|
|
Hi,
I thing this is not possible of removing close button. Because the form loaded by means of inherit from the form class. But we use control box said to be False n Remove all text in text in the Text Properties. Which will remove close button n Max n min buttons also. Then it is batter to create of ur own of Max n Min button...
Senthil S
Software Engineer
|
|
|
|
|
Thank you for your reply
I don't use Form , I want to disable Close button of any window in system , using Window Style flags
Among all Window Style flags , I find that the "SysMenu" flag is only flag to remove Close button ( plus system menu and other titlebar buttons )
But , I can create a Form with disabled Close button , by this way :
1. Handling WM_StyleChanging message , don't allow changing "SysMenu " style
2. Set Form.ControlBox=False
This is the picture[^]
And , I don't know why , when I use Spy++ to view Form's window styles , before and after disabling Close button ( using above two steps ) , Form's window styles doesn't change
My question is : How to disable Close button using Window Style flags ?
|
|
|
|
|
Senthil S wrote: Senthil's Reply for
Why do you prefix your replies thusly? I'm not making a critisism or anything, I'm just curious.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
In Form Closing Event place the code e.cancel=true
prabumj
Prabumj@gmail.com
|
|
|
|
|
I will do it by disabling Close menu item in window's system menu
|
|
|
|