|
I'm tryed add, it's work! so, your App should work too, or you override sth.?
|
|
|
|
|
User Error!
Found the problem: was referencing the wrong instance of the form that contained he menustrip. When using the "real" form, everything works as it should.
Thanks for your help.
|
|
|
|
|
Hi,
My situation is this, I have 3 comboboxes (drop down list only, not editable), and If the user changes the value of one of the, the other two should change too.
I have used the SelectedIndexChanged Event successfully to update the other two comboboxes. But I have 2 issues with it, first: The code is not pretty, I have to repeat the same 3 times and secondly everytime a call is made to one combobox's SelectedIndexChanged event the other are called too because I update the indexes of those too in the first call. I know it's kind of hard to understand like this, so here's what I'm doing:
private void SubNetCountCombo_SelectedIndexChanged(System.Object sender, System.EventArgs e)
{
HostCountCombo.SelectedIndex = SubNetCountCombo.SelectedIndex;
newsubnetmaskcombo.SelectedIndex = SubNetCountCombo.SelectedIndex;
}
private void HostCountCombo_SelectedIndexChanged(object sender, System.EventArgs e)
{
SubNetCountCombo.SelectedIndex = HostCountCombo.SelectedIndex;
newsubnetmaskcombo.SelectedIndex = HostCountCombo.SelectedIndex;
}
private void newsubnetmaskcombo_SelectedIndexChanged(System.Object sender, System.EventArgs e)
{
SubNetCountCombo.SelectedIndex = newsubnetmaskcombo.SelectedIndex;
HostCountCombo.SelectedIndex = newsubnetmaskcombo.SelectedIndex;
}
I thought of using a bool variable as a switch, so that everytime I enter each of those events it turns true and when it goes to the other methods I use an if to check for that variable, if it's true I just get out. But it's still not pretty... So.. I'm not sure if there's a better way of accomplishing this..
Thanks!
|
|
|
|
|
If any selection will change the other two,. you'll get into an infinite loop, unless you set some sort of flag which will tell the event handler not to do anything. You can also put all of these into one event handler, and just have it check which control it is working with, and then set the other two.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
mmm.. As I said, any selection changes the other two, But no, I do not get into an infinite loop, It only repeats two times the events and then gets out, but you don't notice it. It's not like it slows down the program or anything.
And about the flag, that's what I said in the end of my comment, I used it, but I just don't like the way it works. I want to know if there's another way to accomplish this, without:
1. Having to use a flag.
2. Having to "repeat the instructions" as I'm doing in the excerpt I pasted here.
Thanks
|
|
|
|
|
Well, you've listed the only options. Either have one event for each, or one event that all three use, that's all there is. As for the flag, I'd have expected code that changes the selected item on the other two, to cause events to fire over and over. If that's not the case, then that's fine, you do not need a flag.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Ok.. Thanks.. That's all I wanted to know...
|
|
|
|
|
Hello,
I have a pdf file that has the whole help stuff in it. Based on the helpId(Which form the user has selected) I should display the correct help page.
Will this below code serve my purpose?
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "Guide.pdf";
startInfo.Verb = helpId;
System.Diagnostics.Process.Start(startInfo);
|
|
|
|
|
This is programming, it's not black magic. You can't just go around making stuff up and expect it to magically do what you want it to. Instead, you should use reference books and google to research the tools you are using.
No. Of course not. You've taken a random property and tried to make it magically do what you want. The verb is a predefined term like 'run' or 'print' that tells the process what to do. There is no way that I know of to make a PDF open on a specific page. You'd have to read the Acrobat documentation to see if it's possible to pass any parameters to Acrobat, to tell it what page to open. As you appear incapable of research, I'll tell you that Arguments is the property on ProcessStartInfo you use to pass an argument to a program. But, you need to find out for yourself if Acrobat will take an argument to do what you want it to.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Abhishek Sur wrote: Atleast you need to open the PDF to your own viewer to have better control rather than opening in Acrobat Reader directly.
Those libraries are not cheap. What's the bet this guy is only interested in free solutions ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
I don't think you can do this using PDF files. If you can make your help files to a CHM file, work with Help.ShowHelp()[^] method by providing appropriate HelpNavigator value.
|
|
|
|
|
Hello,
I am using a MSAccess database date entered into the database are Medium date format ie. dd-mmm-yy format. But when the data is pulled from the db and shown into a datagrid, it's like mm/dd/yyyy hh:mm:ss. But I want only the medium date that is dd-mm-yy format(18-Aug-09). Please help.
Thanks in advance.
|
|
|
|
|
Any half decent database, stores a date as a date. That means, it does NOT store a string in any special format. It stores actual date information. So, in C#, you will end up with a DateTime object, instead of a string. And you can format that any way you like.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Actually this happens as your Localized regional datetime settings is dd-mm-yy.
To format use
DateTime.ParseExact(datestring, "dd-mmm-yy", new CultureInfo("en-US"))
|
|
|
|
|
i want to recieve sms using mcore library. But im getting an error: "invalid response to the message sommand"
if anyone has used mcore, can he or she help me out? its really urgent
plzzzz plzz plzzz reply
|
|
|
|
|
If it's that important, you're best source of information is going to be the people who wrote the library. I'm guessing that would be Infospace.
|
|
|
|
|
|
This may be urgent only for you. And putting this in subject line is considered as rude.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
maham siddiqui wrote: plzzzz plzz plzzz reply
icnthlp
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
I want to know how can I detect which email client is the default on the system using C#?
|
|
|
|
|
|
I am working on one apllication and now i am testing with windows7 but as we all know that there is no email-option available in windows7.but i want to make my code very generic that it should detact the default email client and if client not availble then display some genaric message like "perticular email client not availbel ".
Please suggest me on the same asap.
regards
raj
|
|
|
|
|
Hi,
I am developing the Text editor using c#.net
I want to implement print functionality and the printed pages should be WYSIWYG format
In my application I am using rich textbox control which acts as a single page, so for every page I am using a new rich text box control. When ever I have tried to print then the printed content should be like WYSIWYG format
Thanks
Vijay Kommalapati
|
|
|
|