|
It will start when you turn the timer on again.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Put your work into a thread, and fire off the thread each time the timer ticks. You can even prevent multiple threads from kicking off with appropriate code in the tick handler.
Personally, I wouldn't use a Timer object because it's the lowest priority message in Windows, and in a busy system, there's no guarantee the message will even be handled. Instead, I use a BackgroundWorker object for timers because they can be easily aborted. Sure, it's more code (go forbid a programmer should have to actually write some code), but it's much more reliable and controllable.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Personally, I wouldn't use a Timer object because it's the lowest priority message in Windows, and in a busy system, there's no guarantee the message will even be handled. Instead, I use a BackgroundWorker
That is true for a Windows Forms timer running on the UI thread. But the OP is writing a service, so he's probably using System.Threading.Timer or System.Timers.Timer . AFAIK, both of them use the ThreadPool, and so does BackgroundWorker
|
|
|
|
|
i can do parent dynamic gridview --> child dynamic gridview but ive a problem at the interface of triple dynamic gridviews how do i do for that ??
|
|
|
|
|
I prefer to 'Hungarian Notation' than 'PascalCase' to named controls.
e.g.
I like use btnOk, btnCancel, txtName, txtAge
but not okButton, cancelButton, nameTextBox, ageTextBox.
which one do you like? and why?
Glad to discuss with you and best wishes.
|
|
|
|
|
The former, but only with controls. When I need to store the user's name in a string, it's always userName, never strUserName.
Cheers,
Vıkram.
I've never ever worked anywhere where there has not been someone who given the choice I would not work with again. It's a job, you do your work, put up with the people you don't like, accept there are probably people there that don't like you a lot, and look forward to the weekends.
- Josh Gray.
|
|
|
|
|
Yes, I'll named control like txtUsername, and named variable userName.
But now, I have to named control like userNameTextBox... but I don't like...
Glad to discuss with you and best wishes.
|
|
|
|
|
The actual class: MyTextBox
The class instance: myTextBox
Its properties and events: Text ... TextChanged
Why, to follow the convention that is used almost everywhere, and so I can see instantly if I'm working with an instance or a static
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I use buttonOK , checkboxCheckMe , etc. That way, all controls of the same type are grouped in the same place in intellisense.
You could take it a step further and maybe use ctlButtonOK , and ctlCheckboxCheckMe , and that would put *all* of the controls in one single group in intellisense, yet still separate the controls by type within the group.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: all controls of the same type are grouped in the same place in intellisense.
Agree with you, especially for the same type control.
Glad to discuss with you and best wishes.
|
|
|
|
|
I want to get a device state(enable or disable)?
If i have a device name, how to get it?
Thank a lot.
|
|
|
|
|
What kind of device are you working with?
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Try using WMI to get the device.
Glad to discuss with you and best wishes.
|
|
|
|
|
getting the row index in c#
|
|
|
|
|
rowindex in which control
cheers,
sneha
|
|
|
|
|
Hi everybody,
I am unable to get the index of the row which is selected by the user through checking a checkbox.
After getting the index I want to delete the row directly from the datagrid on that particular index.
There is no interaction with the datagrid..
Please help me out.Its urgent...
cheers,
sneha
|
|
|
|
|
Well, seeing as it's urgent!
How about using the CurrentRow property of the DataGrid?
|
|
|
|
|
You mean to say the "currentrowindex" property.But it's not working.
Give me some idea.
I am using this code to update the row according to the user's input.
protected void BtnUpdate_Click(object sender, EventArgs e)
{
dt = (DataTable)Session["Cart"];
CheckBox chkSelected = new CheckBox();
foreach (DataGridItem dgItem in DataGrid2.Items)
{
chkSelected = (CheckBox)dgItem.FindControl("chkSelection");
if (chkSelected.Checked == true)
{
TextBox TxtQTY = (TextBox)dgItem.Cells[2].FindControl("TxtQTY");
int Txt2 = Convert.ToInt32(TxtQTY.Text);
Label lblProduct_Id = (Label)dgItem.Cells[0].FindControl("lblProduct_Id");
string id2 = lblProduct_Id.Text;
Label lblDescription = (Label)dgItem.Cells[1].FindControl("lblDescription");
string desc2 = lblDescription.Text;
Label lblPrice = (Label)dgItem.Cells[3].FindControl("lblPrice");
float price2 = Convert.ToSingle(lblPrice.Text);
Label lblCost = (Label)dgItem.Cells[3].FindControl("lblCost");
float cost2 = Convert.ToSingle(lblCost.Text);
float final_cost = price2 * Txt2;
DataRow myrow = dt.NewRow();
myrow["REF"] = id2;
myrow["Description"] = desc2;
myrow["QTY"] = Txt2;
myrow["Price"] = price2;
myrow["Cost"] = final_cost;
dt.Rows.Add(myrow);
dt.AcceptChanges();
Session["data"] = dt;
}
}
DataGrid2.DataSource = dt;
DataGrid2.DataBind();
}
cheers,
sneha
|
|
|
|
|
You can get the index of the checked row DataGridViewCellEventArgs in the CellContentClicked event.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
Hi,
I am using datagrid not the datagridview.Please give me an idea for datagrid.Believe me I tried a lot but I am unable to do this.
cheers,
sneha
|
|
|
|
|
hi,
instead of using foreach, use for(int rowindex=0;rowindex<dtg.items.count;rowindex++)>
.thus 'rowindex' will giv the rowindex...try this....
|
|
|
|
|
|
Nikki05 wrote: Am just in my highschool.
So ask your teacher, thats what they get paid for. The idea of CP is to help people with specific problems, not do their (home)work for them. If someone gave you the code what would you learn? How to Copy and Paste?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Pls help me in implementing kerberos authentication in web application using C#...
|
|
|
|
|
Repost[^]
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|