Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / March 2007

Tip: Looking for answers? Try searching our database.

More problems post SP1.  ContextMenuStrip this time.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dale - 07 Mar 2007 03:53 GMT
I apologize for becoming the most prolific poster in the group, it seems but
I am having a LOT of weird problems since installing SP1.  I can't say for
sure it's related to SP1 but today's problem is an application that I have
worked on since early betas of Whidbey and not had these problems in the IDE
before SP1.

The application includes a form with a ContextMenuStrip.  Every time I
choose the ContextMenuStrip in the Components tray, my CPU utilization goes
to 100%.  I can choose any other component without this problem.

As a test, I first added a context menu to a form in another application.  
There was no excessive CPU use.  So I went back to the problematic
application and added a second context menu to the form.  Again, no excessive
CPU usage.  

That is problem 1.  Why is my CPU usage going to 100% when I select this one
ContextMenuStrip?

Here's problem 2:

Then, I added several items to the second context menu to continue my test.  
When I tried to switch from the design view to I got a message that said the
design view changes could not be added to the source code and to open the
source file again.  The message said the error was the old "Unspecified
Error" problem - geeze, I hate "Unspecified Error" in VS2005.

I tried several times switching from  design view to code view with the same
problem.  Finally, worried I was going to trash my code, I closed VS2005
responding to the save file dialogs by choosing not to save any modified
files.

Problem 3:

After closing VS2005 and telling it to not save any files, I re-opened the
project and, lo and behold, the second ContextMenuStrip is still in my form -
even though I never saved or built the project and told VS2005 not to save
when I closed it!

But I was able to open the Code view, build the project, and run it, so,
apparently, now the source code file was properly updated.

So, problem 2 went away after restarting VS2005 - seemingly.  Problem 3 I
can work around by deleting the ContextMenuStrip and all of the associated
items.

But I really would like to solve problem 1.  The 100% CPU usage is really
dragging things down.

Thanks,

Dale
Signature

Dale Preston
MCAD C#
MCSE, MCDBA

Dale - 07 Mar 2007 04:30 GMT
> I apologize for becoming the most prolific poster in the group, it seems but
> I am having a LOT of weird problems since installing SP1.  I can't say for
[quoted text clipped - 47 lines]
>
> Dale

Some more information on this ContextMenuStrip problem.  The original
context menu had only 3 events handled.  Opened, Closed, and just one of the
items had a Click event handled.  I deleted all event subscriptions and the
problem still exists.  Next, I deleted all items and every reference to the
items.  I also made my new test context menu, ContextMenuStrip2 the context
menu for the form.  Still, the problem persists with ContextMenuStrip1.

Here is all of the references to the troublesome context menu in my code -
every single one.  As you can see, there's nothing unusual about the code.  
And this problem has survived multiple reboots.

AlbumArtForm.resx:

 <metadata name="contextMenuStrip1.TrayLocation"
type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a">
   <value>495, 17</value>
 </metadata>

AlbumArtForm.cs in fields declarations:

       private ContextMenuStrip contextMenuStrip1;

AlbumArtForm.cs in InitializeComponent():

           this.contextMenuStrip1 = new
System.Windows.Forms.ContextMenuStrip(this.components);

and then, still in IniializeComponent():

           //
           // contextMenuStrip1
           //
           this.contextMenuStrip1.BackColor =
System.Drawing.Color.Transparent;
           this.contextMenuStrip1.Name = "contextMenuStrip1";
           this.contextMenuStrip1.ShowImageMargin = false;
           this.contextMenuStrip1.ShowItemToolTips = false;
           this.contextMenuStrip1.Size = new System.Drawing.Size(128, 26);
WenYuan Wang - 07 Mar 2007 13:07 GMT
Hi Dale,

It seem like this issue is only related to your special Control of special
Solution and the project created by early betas of Whidbey. Because it
looks fine in the code snippet, would you please send me your problem
project if it is not complicated? I think we should have to drill into the
project.
My alias is v-wywang@microsoft.com

Have a great day,
Sincerely,
Wen Yuan
Dale - 08 Mar 2007 03:29 GMT
While the project was originally begun in Whidbey, it has been under the
release version of VS2005 since the release version was released.

I really would love to have found out what was causing the problem as I am
sure you would be interested in knowing too.  Unfortunately, I had to move on
so I deleted all references to that one menu and just went with the test one
I had put in the project.  I wish I had thought to make a backup with the
problematic control.

The test one had all the exact same settings, event handlers, options and
properties, and menu items - yet it worked.

Thanks for taking the time to reply and if the problem shows up again, I'll
let you know.

Dale
Signature

Dale Preston
MCAD C#
MCSE, MCDBA

> Hi Dale,
>
[quoted text clipped - 8 lines]
> Sincerely,
> Wen Yuan

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.