|
The easiest way would be a Forms.Timer
|
|
|
|
|
I need to Remotely Get Encoder Statistics from a Windows Media Encoder 9 Running on a Remote Computer.
The SDK Documentation, only shows VB and C++ exampls. Is there any way to zaacess it through C#?
|
|
|
|
|
You really should wait way longer than 40 minutes before posting again about the same issue and with very little more information!
Spamming the boards won't get an answer any quicker and will probably make some people ignore you.
|
|
|
|
|
Hello.
Have been trying to search for the real working behind the concept of boxing/unboxing.
I understand the concept and its utility, but dont know what exactly happens behind the scene as per memory address and the apropos changes in the stack and heap memory.
Any information or reference will be of help.
Thanks.
|
|
|
|
|
|
www.kirupa.com
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
hi friends,
i am doing my project in c# with asp.net
i am using 12-hour format time and
i have two textboxes such as start time and reach time...
i want to compare two textboxes time values being entered...
compare validator is not working since i am using 12-hour format..
can u suggest me the alternative...
regards
gayathri...
gayathri
|
|
|
|
|
|
Hi,
Dont try to compare the strings without the help of DateTime.
Let the DateTime class parse your date strings, then compare the DateTime values.
|
|
|
|
|
Hello all,
I have a form and a few comboboxes in it. When the user drops down a combobox and selects a different item, I wish to execute a piece of code, which involves a alot of database transactions. I am handling the SelectedIndexChanged(object sender, EventArgs e) event of the combobox. But this method gets called even if the user has selected the same item, which was previously selected. Am I handling the wrong event or is there anything more I need to do?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
brahmma wrote: Am I handling the wrong event
Ofcourse, you are handling the right event.
All you need is a simple if statement block like this
if(comb.SelectedIndex !== currentSelection)
{
/// All your code goes here
/// Where currentSelection is a user defined variable which must be
/// member of your Form class
}
Does this help
Mohamed Gouda
Egypt
|
|
|
|
|
Hello there,
Thank you very much for your inputs. I don't get it. Isn't the handler supposed to check it? The name of the handler is SelectedIndexChanged and why in the hell should I check if it is changed or not? Why does this event handler even exist? Shouldn't this event be triggered only when the selected index of the particular combobox is changed? Oh crap! Is this the way C# works? I think I am going back to MFC.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Unfortunately, there are a lot of PropertyChanged events in C# that are fired whenever a value is set whether a the value really changed or not.
And it is very annoying!
But going back to MFC isn't really an option for me
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Urs Enzler wrote: Unfortunately, there are a lot of PropertyChanged events in C# that are fired whenever a value is set whether a the value really changed or not.
And it is very annoying!
I'm annoyed too! But, I think I must get used to it rather than bitching about it
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Mohammed Gouda wrote: if(comb.SelectedIndex !== currentSelection)
What is that currentSelection here? Am I supposed to maintain a static variable where I store this information?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
brahmma wrote: Am I supposed to maintain a static variable where I store this information?
Yes, that is what I mean
Mohamed Gouda
Egypt
|
|
|
|
|
Then why do we have an OnSelectedIndexChanged event handler? Doesn't that suck?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Hello,
You are write!
Also the SelectedValueChanged has this behavior. It doesn't check for current setting!
Maybe the TextChanged helps you here. (I know that it could be multible text in the Items!)
All the best,
Martin
|
|
|
|
|
Martin# wrote: Maybe the TextChanged helps you here.
No, that has the same behavior too.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
brahmma wrote: No, that has the same behavior too.
Really?
I just tested it!
Selected same Item and event was not fired.
All the best,
Martin
|
|
|
|
|
Thanks for pointing it out. I had two projects open, and got confused between both. But I think I may run into trouble, because the combobox item text might be changed dynamically depending on a table updation in the database. Somehow, this problem is fixed for now. Thanks a bunch again.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Martin# wrote: I know that it could be multible text in the Items!
Exactly! What can I do in case I have multiple items with the same text in the ComboBox?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Hello,
brahmma wrote: What can I do in case I have multiple items with the same text in the ComboBox?
The question is what do you want it to do.
All the best,
Martin
|
|
|
|
|
Hmm... I want to execute a piece of code whenever the user changes his selection in a combobox. But the TextChanged handler may not work if I have duplicate items in the combobox. And the SelectedIndexChanged will be called even if the user selects the same item again, which sucks. So, do I need to check manually if the user has selected a different item every time and then execute my code? If yes, then why do we have event handlers?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Hello,
brahmma wrote: And the SelectedIndexChanged will be called even if the user selects the same item again, which sucks
So true!
brahmma wrote: So, do I need to check manually if the user has selected a different item every time and then execute my code?
I think in your special case, yes!
brahmma wrote: If yes, then why do we have event handlers?
I guess this statetment comes out of frustration.
An other possibility is, you do what MS was not willed todo:
inherit your own combobox, like this:
public class SpecialComboBox : System.Windows.Forms.ComboBox
{
private bool init = true;
private int oldIndex = 0;
public SpecialComboBox()
{
}
protected override void OnSelectedIndexChanged(EventArgs e)
{
if((oldIndex!=this.SelectedIndex)|| init)
{
init=false;
oldIndex = SelectedIndex;
base.OnSelectedIndexChanged (e);
}
}
}
This should do it!
All the best,
Martin
|
|
|
|