Re: [2.0] Easy question for someone who knows what they are doing...
I suggest that you read the Forms in VB.NET tutorial in my signature. The code used is all VB but the principles are all exactly the same in C#. You can use one of the code converters in my signature to convert the VB code to C#.
Re: [2.0] Easy question for someone who knows what they are doing...
Originally Posted by jmcilhinney
I suggest that you read the Forms in VB.NET tutorial in my signature. The code used is all VB but the principles are all exactly the same in C#. You can use one of the code converters in my signature to convert the VB code to C#.
You really have everything in your signature.
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson My Blog
Re: [RESOLVED] [2.0] Easy question for someone who knows what they are doing...
**EDIT**
Fixed it. But I'll leave the question in place, since it might help someone. It was confusing as heck.
The function that was taking the menu list and filling the combo box was inside of the options form constructor. I guess it was trying to fill the combo box with nothing because the menu itself on the main form didn't exist. I changed it to do my startup routines on form_load rather than in the constructor.
** EDIT**
Hmm, ran into a road block which is making no sense to me.
Here is my code inside of the Options form:
Code:
string mnuItem;
for (int i = 0; i < formMain.cMenu.Items.Count; i++)
{
mnuItem = formMain.cMenu.Items[i].Text;
if (mnuItem.Length != 0) cboMenuItem.Items.Add(mnuItem);
}
The IDE says it's a null reference and explodes (the first line where it gets the count). If I comment all that code out, and replace it with: formMain.Opacity = 0.50;
Then the main form's opacity changes to 50% (as far as I know it's working then).
Any idea why I can't get the context menu's contents?
I did a quick hack for now, by passing the form object directly to the function that's handling this but that doesn't seem right.
I set the cMenu to internal as well as try setting all the menu items to internal, that didn't do it.
Last edited by ThisIsMyUserName; Jun 6th, 2006 at 03:59 AM.