|
This means you have a race condition. Stopping the program means that everything sorts itself out in the time it takes for the breakpoint. Is the app multithreaded ?
Ah.... that's interesting. Obviously, checking the text has a side effect on the code. What if you add a line like string s = this.comboBoxTresReport.Text , does that solve the problem ? Note, I am not advocating this as a solution, just wondering if the root issue is that when the string is first evaluated, it works for some reason.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for your prompt response.
Christian Graus wrote: Is the app multithreaded ?
Being new to this I really don't know if it is or isn't. I haven't specifically done anything to make it so or otherwise .
Christian Graus wrote: What if you add a line like string s = this.comboBoxTresReport.Text
I added that to code just before mine and it didn't make any difference.
Glen Harvy
|
|
|
|
|
Then it's not multithreaded.
OK, then the evaluation in the debugger is what causes the difference. That's pretty strange.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Could it be that the combobox is not filled (what is the right term ) at the time that I'm getting it's value? Using the debugger would fill it wouldn't it?
If this is the case, how do I make sure the combobox is filled prior to me getting it's value?
Glen Harvy
|
|
|
|
|
Using the debugger shouldn't be putting values in the combobox, but you can check by checking the combo.Items.Count property ( or something like that. ) If there's any chance the combo is empty, your code should have that check anyhow.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Glen Harvy wrote: What have I missed doing?
Outside guess: CultureInfo...
|
|
|
|
|
Glen Harvy
|
|
|
|
|
Glen Harvy wrote: string fDate = this.comboBoxTresReport.Text.ToString();
DateTime fromDate = Convert.ToDateTime(fDate);
Are you executing this code in response to a button click or some UI event?
|
|
|
|
|
The method is called from the Form_Load method as well as a response to data changes in other user controls later in the program. As far as I can tell, it only fails when called from Form_Load. I have also made sure the call is the final call in the Form_Load method.
I have "worked around" the issue by checking if fDate is empty (which is probably good coding practice anyway) and then filling it with what the fDate does/should/will hold when viewed by the user.
Glen Harvy
|
|
|
|
|
I have a class derived from System.Windows.Forms.ComboBox called CalcModelComboBox
I have a form that contains a CalcModelComboBox. Originally I created the form with a ComboBox and came back and changed the type of the control in the code to CalcModelComboBox
Now when I try and open the form in the designer it shows an exception and doesnt open the form. The error message is "Unable to load one or more of the requested types"
Both the form and the CalcModelComboBox are in the same namespace and I have tryed using the fully qualified name of CalcModelComboBox in the form code. The application runs fine its just a pain to make changes to because of this error.
Any ideas how I can fix this?
Objects in mirror are closer than they appear
|
|
|
|
|
If you've done a build and this still happens, it means you need to look at the code, it's common for a custom control to break in design mode, because variables that are always set to valid values when the program runs, are not valid in the designer.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks Christian, I've tried a rebuild and it's still no good. The ComboBox class is very simple, it has a constructor with no arguments and no internal variables.
There is one method that populates the control and one property that gets or sets the selected item.
The code was originally written with vs 2003 and I think this is the first time I have looked at this code since I converted it to vs 2005
Objects in mirror are closer than they appear
|
|
|
|
|
OK, what does the getter return by default, null or an empty string ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
get
{
return this.SelectedItem as CalculationModel;
}
Im guessing that if this was called at design time it would return null. I removed this code and still have the same problem.
In the error screen displayed it says
'Retrieve the LoaderExceptions property for more information'
and then a call stack. Do you know how I retrieve the LoaderExceptions property?
Objects in mirror are closer than they appear
|
|
|
|
|
Do you want to mail me the control, and I'll have a look ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
For anyone who is interested the solution to this was to specifically add the exe of the project containing the combo box control to the ToolBox window. The control was then available in the toolbox and I was able to open my form in the designer.
Objects in mirror are closer than they appear
|
|
|
|
|
You probably need a default constructor
|
|
|
|
|
Hi Guys, is there any way to find whether a string coming from SQL is empty ("") or null? I'm getting an empty string even if value in my SQL database is null. Any help will be appreciated.
Thanks
|
|
|
|
|
xoxoxoxoxoxox wrote: I'm getting an empty string even if value in my SQL database is null.
You probably have some code in the middle doing this, the value should be DBNull.Value if it's null in the database.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello, may be you can help me with this problem. I want to extract the first frame of a quicktime movie. Is it posible to use the library to export the first frame of a quicktime movie using C#? Do you know some code in C# or vb.net or a COM dll to extract the first frame of a mov and save it as bmp or jpg without UI and command line.
Thanks a lot people !!!!
|
|
|
|
|
Search for the QuickTime SDK.
|
|
|
|
|
It was working, but not it's not.
I have a tool strip label that I set the IsLink Property to true, but when I click on it, it no longer opens a browser!
The ToolTipText property is set to the web
address: http://benchmark.jconserv.net
Using VS 2005
Any ideas?
Patrick
-- modified at 16:12 Sunday 13th August, 2006
|
|
|
|
|
Stick^ wrote: ve a tool strip label that I set the IsLi
I don't think link labels launch browsers automatically. Instead, clicking the link will raise a LinkClick event or other. At which point, you can launch a browser using Process.Start("http://...");
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: And in this corner, the Party of Allah
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Thanks, that fix works.
Patrick
|
|
|
|
|
Hi all,
I need to show the server's folder structure in treeview using asp.net2.0 and c#.
Can any body helps will be thankful.
Thanks in advance
Chinna.
|
|
|
|