Solution:
1. Expand the "Windows Form Designer generated code" section in the code view of the form.
2. Find out following statement in intializecomponents. (Replace Toolbar with actual toolbar control name)
ToolBar.Buttons.AddRange(...);
3. Cut above single line statement and Paste that statement of code at the end, after all of the properties of that ToolBar control have been set. [IMP: If Image list is used then paste above line after imagelist code block]
This will solve the problem.
[IMP: adding new controls or events, cause the IDE to regenerate the code, so the statement that causes the problem returns to its original location. Therefore, every time that you build and test the application, check the code file to make sure that above statement has been moved at the end]
1 comment:
thanks this solution is working.
Post a Comment