|
pariisa wrote: rb.Text= dt.Rows[0][i].ToString();
i-1
please read and apply my sig !
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I have a label with some text showing the version number of the program on my start up screen. On the start up screen there is an image which the version number is on top of, my problem is when I select transparent as my BackColor it shows up as a gray box. Any help?
|
|
|
|
|
Make the image as BackgroundImage of your form then set the label BackColor to Transparent
Good Luck
|
|
|
|
|
Controls as not transparent to other controls behind them. What you're really telling the Label control is to take on the properties of the background of the form that's hosting the Label control.
In other words, the Label control uses the background settings of the Form it's on. Transparent is NOT really transparent.
|
|
|
|
|
MicealG wrote: would this cause the error I'm getting?
Yes
|
|
|
|
|
my stupidity! After those 2 responders noted my mixture of c++/c#...
heres' the actual c++ code:
This was written in c++ language... I am wondering is there a way to change that into c#?
example code:
int linecounter = 4;
unsigned char parity = 0; // cksum variable
byte short checksum = 0; // cksum variable
static long RecordTime; // cksum variable
unsigned char beef[256];
RecordTime = time(NULL);
beef[0x0] = RecordTime / (256 * 256 * 256);
beef[0x1] = RecordTime / (256 * 256);
beef[0x2] = RecordTime / 256;
beef[0x3] = RecordTime % 256;
beef[0x4] = linecounter % 256;
for (int i = 0; i < 256; i++)
{
checksum += beef[i];
parity ^= beef[i];
}
beef[0x5] = parity;
beef[0x6] = checksum / 256;
beef[0x7] = checksum % 256;
-- modified at 15:06 Monday 6th August, 2007
|
|
|
|
|
Hi,
there would be no problem doing the same in C# if it were a valid and correct C program.
the function time_t time( time_t *timer ); returns current time in seconds;
DateTime.Now can provide that.
there are several problems in the "original" code though:
1. byte is not a keyword in C
2. I would prefer beef to be unsigned since it represents parts of a bigger number
3. the for loop goes to 256, that makes no sense
4. checksum/256 will always be zero; checksum should have been unsigned short.
5. strictly speaking the assignments to beef[] need a cast since it is a downcast
good luck !!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
it seems your code is the mixture C#+ buddy.
maybe this going to help
class Program
{
static int RecordTime;
static int time(object obj)
{
return Environment.TickCount;
}
static void Main(string[] args)
{
int linecounter = 4;
byte parity = 0;
byte checksum = 0;
byte[] beef = new byte[8];
RecordTime = time(null);
beef[0x0] = (byte)(RecordTime / (256 * 256 * 256));
beef[0x1] = (byte)(RecordTime / (256 * 256));
beef[0x2] = (byte)(RecordTime / 256);
beef[0x3] = (byte)(RecordTime % 256);
beef[0x4] = (byte)(linecounter % 256);
for (int i = 0; i < 256; i++)
{
checksum += beef[i%8];
parity ^= beef[i%8];
}
beef[0x5] = parity;
beef[0x6] = (byte)(checksum / 256);
beef[0x7] = (byte)(checksum % 256);
}
}
and your code don't work in both c# and C++ because the lines I commented
|
|
|
|
|
Please don't change the original post completely. Now you have screwed up the timeline of the thread...
The code is still not correct C++ code. There is no "byte short" data type in C++.
The code that you have posted doesn't even make sense. You calculate the checksum and parity on data that you don't even put in the array. Then you overwrite elements in the array, which renders the checksum and parity totally useless, as the data that was used to calculate them doesn't exist any more.
---
single minded; short sighted; long gone;
|
|
|
|
|
I gotta remove this post from the discussion... lots of confusion going on here with this post... I will repost later for more clarification.
So how do I remove this post?
|
|
|
|
|
Please don't remove the post, it will most likely screw up the forum. There's a bug in the forum that makes it show the replies to removed posts mixed up with other threads.
Just make an addition to the text of the original post where you explain the situation.
---
single minded; short sighted; long gone;
|
|
|
|
|
I may have to end up creating a class library for this checksum/parity function as it is written in C language.
|
|
|
|
|
Why? If it's anything like the code that you posted, it can easily be rewritten in C#.
---
single minded; short sighted; long gone;
|
|
|
|
|
I've got it...
I can change this time(NULL) in c language into c#...
in C:
time(NULL)
in C#:
DateTime d1 = new DateTime(1970, 1, 1);
DateTime d2 = DateTime.Now;
TimeSpan ts = new TimeSpan(d2.Ticks - d1.Ticks);
int recordTime = Convert.ToInt32(ts.TotalSeconds);
|
|
|
|
|
Hi all!,
I want to ask if exist a free tool for skinning and if yuo can give me some link, for tool i mean:
-Example Code
-Skin
-Skin Editor
Thanks and Bye...
Bye
|
|
|
|
|
What is it that you want to skin???
|
|
|
|
|
|
oh THAT...
sorry, NO idea whatsoever...
|
|
|
|
|
pls help me...
Bye
|
|
|
|
|
You are going to be hard-pressed to find a control that does what you are talking about, for free. You will either have to buy the control, which will be a bummer because you will have to pay for a licence for each copy application you use it on. You will probably just have to develop one yourself. Good luck
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I now, it's for that i have asked you..., thanks however, another question, how i can to set the transparency color of a MDI child form, i' ve tried but it does not work, how i can do it? thanks
Bye
|
|
|
|
|
hello, im just a newbie in using C# language. Im creating a CASE Tool. We all know that case tool has Open and Save buttons that can save its own file.How to save values of variables to a filename and save to the computer??? Then the saved file later be opened using the program then load the values to restore the last setting..
please. help...thanx in advance
|
|
|
|
|
I think its better to have a look at MSDN and search for System.IO and Serializing, there are some examples there.
![Smile | :)](https://www.codeproject.com/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
You want to check out object serialization.
Here's a good start:
http://www.codeproject.com/csharp/objserial.asp?forumid=3218&mpp=50&df=100&fr=51&select=2169777&msg=2169777
|
|
|
|
|
I am working on an application using Visual C# (2.0). I want to have something in my application that supports signatures, now I dont`t know how to do it so that it can support ignatures using pen.Please tell Is there any hardware require, and if require then definitly there would be require some interface I mean a software . Please help me how to solve this problem.
|
|
|
|