Author
|
Message
|
JSW W.
|
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 127,
Visits: 1
|
Hello My NdockingToolbar keep changing location after each open/close of VS2008. Normally each try to stay on it own row and would not stay on the same row as I dragged to.
What would be proper way to set location for instance:
top row 1: bar1 + bar2 + bar3 row 2: bar4 + bar5
Left col 1: bar6 + bar7
Bottom row 1: bar8 + bar9
and these stay the same for each open or close VS? Thanks
|
|
|
Angel Chorbadzhiev
|
|
Group: Forum Members
Last Active: Last Month
Posts: 139,
Visits: 184
|
Hello JSW W., You can save the current state of docking toolbars on exit and load it back when the application starts. Regards, Angel.
|
|
|
JSW W.
|
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 127,
Visits: 1
|
Hello
I try the similar to your example, save(), load(). It got strange result such as 1) Some icon images incorrect 2) and then the event did not handle correctly - become dead clicks. 3) the rows are correct but order of commands in the row still not correct as saved.
This test is done during form load. The save is done before exit program.
|
|
|
Angel Chorbadzhiev
|
|
Group: Forum Members
Last Active: Last Month
Posts: 139,
Visits: 184
|
Hello JSW W., Can you describe or send us a code snipped how do you set the images of the commands, how do you attach to the event that didn't handle correctly. Also can you check whether the PersistencyFlags property of the manager is set to All. Regards, Angel.
|
|
|
JSW W.
|
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 127,
Visits: 1
|
on load m_NCB_State.Manager = m_CmdBarsManager m_NCB_State.PersistencyFlags = NCommandBarsStateFlags.Toolbars 'Dim userCBSfile As String = m_current_path + "\Res\NCB\user.cbs" 'Dim orgCBSfile As String = m_current_path + "\Res\NCB\org.cbs" 'Dim userFile As New FileInfo(userCBSfile) 'Dim orgFile As New FileInfo(orgCBSfile) 'If userFile.Exists Then ' m_NCB_State.Load(userCBSfile) 'Else ' If orgFile.Exists Then ' m_NCB_State.Load(orgCBSfile) ' End If 'End If
on save Dim userCBSfile As String = m_current_path + "\Res\NCB\user.cbs" m_NCB_State.Save(userCBSfile)
I just use these code here. I could not make tool bar stay in it position, also some NComandBar as show wrong icon ids, it seems to attached to different image list.
Nice website update by the way.
What was missing above, pls ignore the commented lines? - since it is yet working so i commented out.
|
|
|
JSW W.
|
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 127,
Visits: 1
|
Also i attached icon from design page, it only problem when load state from file.
|
|
|
Angel Chorbadzhiev
|
|
Group: Forum Members
Last Active: Last Month
Posts: 139,
Visits: 184
|
Hello JSW W., When the NCommandBarsState saves and loads the toolbars it keeps only the image list of the NCommandBarsManager and not image list of each toolbar. To save and load the images correctly, please set the ImageList of the NCommandBarsManager only and set the ImageIndex of each command to the images of this list. To be able to fire click event of a command after the state was loaded you should be attached to nCommandBarsManager.CommandClicked event instead of attaching to Click event of each command. Regards, Angel.
|
|
|
JSW W.
|
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 127,
Visits: 1
|
There could be problem for my image List as it set to different transparent colors for each list - also I have a number of images per list so I kind of need them in multiple lists.
Attached all event to nCommandBarsManager.CommandClicked is possible but I have many menus and sub menu so are custom toolbox - there might be some thing i have not oversee.
Are there no alternative to handle the position for each NCB row order and column?
|
|
|
Angel Chorbadzhiev
|
|
Group: Forum Members
Last Active: Last Month
Posts: 139,
Visits: 184
|
Hello JSW W., To be able to distinguish which command is clicked when NCommandBarsManager.CommandClicked fires you can set and then check the ID property of each command in command bars manager. This approach is demonstrated in Command Bars -> Persistency example from example application provided with installation package. The only way to determine the position is described in this topic http://community.nevron.com/Forum/shwmessage.aspx?ForumID=2&MessageID=3188. Regards, Angel.
|
|
|
JSW W.
|
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 127,
Visits: 1
|
So is it not possible to use multiple image lists?
My problem is that each image list I set different transparent color. Can I set multiple transparent color in a list?
About the link, I also previously mentioned that the CmdBarsmanger.ToolBars is fix in your editor to sort by alphabet. So I still could not find way to order the toolbars.
In your manager -> toolbars I did not see, how can you reorder the toolbar position.
If this can be solved, then I not have to save and load, all will be working out.
|
|
|