|
When I found breakpoint and run step by step, I know if my thread is running.
Thank's, I move the question in the forum below article
No one can prevent me to learn something
|
|
|
|
|
asugix wrote: this question especially for Sacha Barber because I learn threading from his article (Beginners Guide To Threading In .NET Part 2 of n).
Then this is the wrong place. Article has a discussion board and author will get a notification when new messages are posted.
asugix wrote: First Question : how to end / exit thread? From tutorial and MSDN help, I assume that thread is end when the thread function ends. Is this true ?
YES.
asugix wrote: how to make event handler just executed once whenever worker thread is done. This is the screenshot :
You are not showing enough code to answer this.
|
|
|
|
|
Hello,
I would like label control with fixed width but length should increase as per the text data. OR run time how can I control label control's width and height depending on text of label control.
Thanks & Regards,
Kumar
|
|
|
|
|
Hello Kumar,
If you would like your label's width to increase depending on the text property of the control, simply set the AutoSize property to true.
By default in VS 2008 this property will be set to true
|
|
|
|
|
Hi Corayzon,
This I had tried, but it is increasing form width also. I want form width should be fixed like 300 and label's text should be wrap to next line.
Thanks & Regards,
Kumar
|
|
|
|
|
Hi,
I have solved using Graphics.measurestring wih 3rd parameter as fixed width.
Thanks & Regards,
Kumar
|
|
|
|
|
Ya thanks Kumar,
Measurestring really helped it.
IF any one wants the code snippet :
int iTop = 0;
for (int icounter = 0; icounter < someCollectionObject.Count; icounter++)
{
Label lblctrl = new Label();
lblctrl.Name = "lbl" + icounter.ToString();
lblctrl.Image = "Put the image locaiton here "
lblctrl.ImageAlign = ContentAlignment.TopLeft;
string txtToShow = string.Empty;
txtToShow = " " + someCollectionObject[icounter];
lblctrl.Text = txtToShow;
lblctrl.Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Bold);
lblctrl.ForeColor = Color.LemonChiffon;
lblctrl.Top = iTop;
Graphics g = Graphics.FromHwnd(this.Handle);
SizeF sz = g.MeasureString(txtToShow, lblctrl.Font, 100);
lblctrl.Width = "You can have any constant width you wanted";
lblctrl.Height = (int)sz.Height -10;
iTop += lblctrl.Height;
}
|
|
|
|
|
Hello All,
I am currently building an easy to use file transfer client that uses UDP to broadcast across the local network with an username and TCP port that is accepting connections on that host. So each user will automatically see every other users on that network without having a central server to pass client details around. Upto this point it works fine, and i am able to transfer files and so forth, no worries.
My problem.
I want users to have the ability to drag files\directories from a users file list which is displayed in a Forms.ListView object to windows explorer which will then start the transfer process within my application and store the selected files in the drop location within windows.
So...
* Client connects to remote host and retrieves directory listing
* Client displays the remote hosts files in a listview
* User drags files from file listing to explorer
* My application then starts the file transfer process and stores the files at the drop location
Help would be much appreciated and commented in the about dialog for the application.
|
|
|
|
|
|
Does anyone know where i can get free icons for my software. Also is it legal to incorporate the window icons into your software. Things like open, save....
|
|
|
|
|
Visual Studio has a folder with icons you can use, otherwise, just google, that's all I ever do.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
I've used google to search for free icons in the past and have found some nice ones
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
try to search "tango images" on google. The're many great and catchy icon / images with GNU licence
No one can prevent me to learn something
|
|
|
|
|
Hi All,
Can someone plz give me an example about how to manipulate data from Ms-Access 2003 db into C# windows form text boxes, such as select, insert and update.
Thanks very much in advance.
|
|
|
|
|
Andie
There are so many articles and resources on CP and the net that a simple search should give you literally 1000s of examples.
Once you have a connection clickety[^] you retreive the data use sql statements and use the resulting data sets to bind to the controls.
Do some research.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i already did a lot of search and couldn't get any, sorry for my poor research skills, and if u can give me a few links would be great.
Cheers
|
|
|
|
|
How can you possibly say you have done a lot of research, my first attempt clickety[^]
There is enough material here meet anyone needs.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I wrote an article on how to use google, perhaps you should read it ? It's here on Code Project.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: I wrote an article on how to use google
Nice one, too. Having good research skills is rather helpful
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
What have you attempted ?
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I have a datagridview that has data in 2 columns that I would like to make into a list (Column [1] and Column[2])
I have been trying...
for (int i = 0; i < dgv2.RowCount - 1; i++)
{
x = (dgv2.Rows[i].Cells[1].Value.ToString());
y = (dgv2.Rows[i].Cells[2].Value.ToString());
}
This works for string values but Column 1 is a Date value and Column 2 is a float from an SQL db, and I need to convert them to double.
It seems to be iterating through the DGV ok but I am not sure how to get the data converted.
Can someone point me in the right direction??
TIA
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Assuming that you added data to the DataGridView column as integers then you can try this:
int Column1Index = 5; // zero based index to column 6 in dgv2
int Column2Index = 7; // zero based index to column 8 in dgv2
int[] Column1 = new int[dgv2.Rows.Length];
int[] Column2 = new int[dgv2.Rows.Length];
for (int i = 0; i < dgv2.Rows.Length; i++)
{
Column1[i] = (int)dgv2.Rows[i].Cells[Column1Index].value;
Column2[i] = (int)dgv2.Rows[i].Cells[Column2Index].value;
}
If your DataGridView columns hold strings then just change the arrays and casts to use strings instead of ints.
Hope it helps
|
|
|
|
|
I think you just made the lights come on. So is this how I would cast to double??
x = ((double)dgv2.Rows[i].Cells[1].Value);
y = ((double)dgv2.Rows[i].Cells[2].Value);
TIA
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Yes. The .Value member of the Cells collection is just a simple object so you can copy just about anything into it. The trick is remembering the type you put into each column so you can cast it properly when you get it back out. Also, it works better to not convert everything to strings before you put them into the DataGridView as a double or int converted to a string certainly won't sort the same as the original double or int values would.
|
|
|
|