|
Hi
I have to work on multithreading concepts in c# windows application.
Design a form with 3 labels and 3 text boxes and a button.
I should enter the time in three text boxes. Three different times. And press the Button.
Label 1 should become green color after the entered time period in text box1.
Label 2 should become Yellow color after the entered time period in text box2.
Label 3 should become Blue color after the entered time period in text box3.
I should have three threads to start three processes. Start the three threads in the button click.
Thread 1 to start the thread and wait for the entered time in text box 1 and make the label 1 green. And so on.
U should enter the time in milli seconds. 1 second = 1000 milliseconds.
So if I want to enter 5 seconds. I should enter 5000 in the text box. I should Write a windows application for this.
Pls anyone explain me how to do this . pls help me to do this sample.
dhol
|
|
|
|
|
I'm no expert in Threading but i could accomplish the same task without explicitly using threads. I used the Timer class.
|
|
|
|
|
Hi,
I have a problem in drawing lines.
I am drawing lines using mouse events when I draw the second line it will start from the end of the 2 line and when i draw the 3 line which should start from the second line but the problem is I CAN OVERWRITE the first line which should not happen AT ANY POINT OF TIME NO LINES SHOULD BE overlapped. When I press a key like 'C' the first line and the last line should coincide with out overlapping any line.
Plz do help me if u have any solution
Advance Thanks to all.
Regards
Suresh
|
|
|
|
|
|
Hi
I am using a third party dll in my project but now I want to use the updated version of this dll.How can I use this dll in dotnet.
Thanks & Regards
Pradeep Kr. Kamlapuri
Pradeep Kr. Kamlapuri
DotNet Programmer
Bhanusoft Tech Pvt Ltd
Noida
|
|
|
|
|
Just put the new DLL in place of the old DLL and you should be fine.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I am creating a page dynamicly(using stringbuilder, then PageOut) I want to be able to dynamically name a button, then get input when that button is pressed. How do I do so?
|
|
|
|
|
How do I pass variables between aspx pages?
Example with CGI
http://www.dotcom.com/thepage.cgi?plugin=0&affiliate=marryweather&randval=213510766
So, how do I pass variables in a similar fashion?
|
|
|
|
|
Hi
Do this
Response.Redirect("mypage.aspx?id1=val1&id2=val2");
On the page mypage.aspx u can retrieve these values as follows
Request["id1"];
Request["id2"];
shashank
|
|
|
|
|
Does anyone know a library containing functions that directly decompresses a packed DIB that is a result of using "avifil32.dll's" AVIStreamGetFrame into a type Bitmap or any other type that a picture box could recognize. Thank you very much!!!
regards,
Raymond
|
|
|
|
|
Hello
I am doing a project in which i have to move a plane on the form from one side of the screen to the other. But the problem aries because i also have to play the sound parallel to it for this purpose i am using threads. I am moving the iamage by cahngeing the postion of the image but the movment is not uniform some time it stops for a whle and some time it moves on fastly.If any one know the solution plz let me know.
|
|
|
|
|
How can i get the CPU serial number or HDD , ...ets
|
|
|
|
|
I think such informations are stored into the registres...
Try this key entry for a start "HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0"
I hope you understand...because is a rough world out there...
|
|
|
|
|
Please help me for developing polar chart in .NET and what will be the parameters for polar chart and functionality?
|
|
|
|
|
Visual Studio .NET uses bit of next level keyboard shortcut keys like KeyChord Sequences CTRL+K, CTRL \ etc.
I have a couple of questions thereto:
(*) In our Windows Forms too, is it possible to implement it by using Keyboard accelerator style itself or is it a Custom Key Press listener?
(*) Can this be used as a Global Shortcut key?
I think KeyChord Sequences would be definitely be a very unique key sequence to maintain keboard shortcuts for the applications.
Please advise...
Vasudevan Deepak Kumar
Personal Web: http://www.lavanyadeepak.tk/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
Hi,
This sounds really crazy but a simple "for" instruction doesn't work in none of my programs.
The bucle is as follow:
for (int i = 0; i == 5; i++)
{
MessageBox.Show("Hello " + i);
}
I've tried this simple piece of code in every function i have, it compiles fine but at runtime it never get into the loop.
I'll try to reinstall the .NET FrameWork, reboot my PC, whatever. It's so simple but now it don't work. What could be possible wrong?
Thanx,
Heinz
|
|
|
|
|
The for-loop isn't entered, cause its condition (i==5) is never fulfilled.
Try i < 5 or i <= 5 .
www.troschuetz.de
|
|
|
|
|
Hello
Please Solve my Problem
I have added an image using Transperency mode to Overlap two images. I got perfectly. But how can I resize that image? If i resize it the transperency is disappearing it is not resizing. Please help me in this
regards
dhanunjay
|
|
|
|
|
I would like to declare the following structures in C# and be able to utilize the Marshal.StructureToPtr() and Marshal.PtrToStructure() on these structures and pointers later on. The reason being that I need structures that can be used for UDP packets that can be filled, sent, received, and later unpacked in the correct order.
In C++, these structures can be somewhat complex due to nested structures.
However, the example below is a very simple C++ nested structure with an attempted C# conversion. In the C#, I have only one query and that can be seen at the very end when transposing the last structure ie IDENTIFIER_T id[12];
Does anyone know a simple way to convert these simple structures to C#????
C++
typedef struct {
int source;
int destination;
int message;
}HEADER_T;
typedef struct {
double X;
double Y;
double Z;
}VECTOR_T;
typedef struct {
int id;
char[32] IdName;
int nameHashId;
}IDENTIFIER_T;
typedef struct {
int id;
char[64] dataName;
HEADER_T header;
VECTOR_T position;
IDENTIFIER_T id[12];
char[128] spare;
}DATA_T;
Attempted C# Equivalent
[ StructureLayout ( LayoutKind.Sequential ) ]
public struct HEADER_T {
int source;
int destination;
int message;
};
[ StructureLayout ( LayoutKind.Sequential ) ]
public struct VECTOR_T {
double X;
double Y;
double Z;
};
[ StructureLayout ( LayoutKind.Sequential ) ]
public class IDENTIFIER_T {
int id;
[ MarshalAs(UnmanagedType.ByValTStr, SizeConst=32 ]
string IdName;
int nameHashId;
};
public class DATA_T {
int id;
[ MarshalAs(UnmanagedType.ByValTStr, SizeConst=64 ]
string dataName;
HEADER_T header;
VECTOR_T position;
// ????? What happens here????
IDENTIFIER_T id[12];
[ MarshalAs(UnmanagedType.ByValTStr, SizeConst=128 ]
string spare;
};
Rob
-- modified at 1:04 Tuesday 6th September, 2005
|
|
|
|
|
|
Thanks but unfortunately the [MarshalAs(UnmanagedType.ByValArray , SizeConst=12)]will not work.
It compiles ok but will cause a runtime error because the MarshalAs can't determine the size of the structure.
SizeConst can only be specified for fundamental types and not for an array of structures.
-- modified at 19:50 Wednesday 7th September, 2005
|
|
|
|
|
|
Hi,
I have a C# .NET framework 2.0 application that draws a bunch of lines and shapes by creating a Pen and a Graphics object and drawing the "art" onto a PictureBox.
Does anyone know how to save or export the drawn image as a bitmap or a jpeg?
This newbie would really appreciate some help with this question!
Thanks
|
|
|
|
|
Hello
Image image;
image.Save("image.bmp", ImageFormat.Bmp);
image.Save("image.jpg", ImageFormat.Jpeg);
Andrew
|
|
|
|
|
Thanks for the quick response! However, I still can't get it to work. Here's my code:
<br />
Pen myPen;<br />
Graphics g;<br />
myPen = new Pen(System.Drawing.Color.Red, 1);<br />
g = pictureBox1.CreateGraphics();<br />
<br />
g.DrawLine(myPen,1,1,30,30);
<br />
Image image;<br />
image = pictureBox1.Image;<br />
image.Save(@"C:\image.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
I get a NullReferenceExcetion was unhandled error. I'm not sure what that means...
Thanks much, Tim
|
|
|
|