Nevron Forum
Home
»
Nevron Open Vision for NET
»
NOV Diagram for .NET
»
How to Modify Menu of NDrawingViewWithCommandBarsControl
Login
Register
Login
Register
Home
»
Nevron Open Vision for NET
»
NOV Diagram for .NET
»
How to Modify Menu of NDrawingViewWithCommandBarsControl
How to Modify Menu of NDrawingViewWithCommandBarsControl
Post Reply
How
to
Modify
Menu
of
NDrawingViewWithCommandBarsControl
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
Goto Topics Forum
Author
Message
Ashley Davy
Ashley Davy
posted 4 Years Ago
ANSWER
Topic Details
Group: Forum Members
Posts: 36,
Visits: 119
I
am
migrating
from
Diagram
.
NET
to
Diagram
NOV
.&
nbsp
; &
nbsp
;
The
code
below
is
what
I
used
to
customize
the
menu
of
Diagram
.
NET
.&
nbsp
;
I
want
to
customize
the
menu
the
same
way
for
Diagram
NOV
NDrawingViewWithCommandBarsControl
.&
nbsp
;
I
have
looked
at
the
examples
but
I
cannot
figure
out
how
to
access
the
menu
and
toolbars
.&
nbsp
;
Can
you
provide
me
with
an
equivalent
example
based
on
the
code
below
to
customize
the
NDrawingViewWithCommandBarsControl
.
Thanks
,
Ashley
&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
0
).
Hide
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
1
).
Hide
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
2
).
Hide
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
3
).
Hide
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
4
).
Hide
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
5
).
Hide
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
6
).
Hide
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
7
).
Hide
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
3
).
Show
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
3
).
Moveable
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
3
).
AllowReset
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
3
).
HasPendantCommand
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
=
New
Collection
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
For
Each
X
As
Nevron
.
UI
.
WinForm
.
Controls
.
NCommand
In
NDiagramCommandBarsManager1
.
Toolbars
(
3
).
Commands
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
X
.
ToString
.
ToLower
= "
start
arrowhead
style
..."
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
.
Add
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
X
.
ToString
.
ToLower
= "
end
arrowhead
style
..."
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
.
Add
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
X
.
ToString
.
ToLower
= "
bridge
style
..."
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
.
Add
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
X
.
ToString
.
ToLower
= "
interactivity
style
..."
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
.
Add
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Next
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
For
Each
X
As
Nevron
.
UI
.
WinForm
.
Controls
.
NCommand
In
ColHold
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
3
).
Commands
.
Remove
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Next
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
6
).
Show
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
6
).
Moveable
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
6
).
AllowReset
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
6
).
HasPendantCommand
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
=
New
Collection
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
For
Each
X
As
Nevron
.
UI
.
WinForm
.
Controls
.
NCommand
In
NDiagramCommandBarsManager1
.
Toolbars
(
6
).
Commands
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
; '
If
X
.
ToString
.
ToLower
= "
connector
tool
"
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
; '&
nbsp
;
ColHold
.
Add
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
; '
End
If
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Next
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
For
Each
X
As
Nevron
.
UI
.
WinForm
.
Controls
.
NCommand
In
ColHold
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
6
).
Commands
.
Remove
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Next
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
4
).
Show
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
4
).
Moveable
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
4
).
AllowReset
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
4
).
HasPendantCommand
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
=
New
Collection
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
For
Each
X
As
Nevron
.
UI
.
WinForm
.
Controls
.
NCommand
In
NDiagramCommandBarsManager1
.
Toolbars
(
4
).
Commands
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
X
.
ToString
.
ToLower
= "
connector
tool
"
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
.
Add
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Next
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
For
Each
X
As
Nevron
.
UI
.
WinForm
.
Controls
.
NCommand
In
ColHold
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
4
).
Commands
.
Remove
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Next
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
2
).
Show
()
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
2
).
Moveable
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
2
).
AllowReset
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
2
).
HasPendantCommand
=
False
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
=
New
Collection
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
For
Each
X
As
Nevron
.
UI
.
WinForm
.
Controls
.
NCommand
In
NDiagramCommandBarsManager1
.
Toolbars
(
2
).
Commands
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
X
.
ToString
.
ToLower
= "
pan
and
zoom
"
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
.
Add
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
X
.
ToString
.
ToLower
= "
property
browser
"
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
.
Add
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
X
.
ToString
.
ToLower
= "
library
browser
"
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
.
Add
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
If
X
.
ToString
.
ToLower
= "
status
bar
"
Then
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
ColHold
.
Add
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
End
If
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Next
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
For
Each
X
As
Nevron
.
UI
.
WinForm
.
Controls
.
NCommand
In
ColHold
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
2
).
Commands
.
Remove
(
X
)
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Next
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
4
).
RowIndex
=
1
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
2
).
RowIndex
=
1
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
3
).
RowIndex
=
2
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
NDiagramCommandBarsManager1
.
Toolbars
(
6
).
RowIndex
=
2
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
Me
.
NDrawingView1
.
Dock
=
DockStyle
.
Fill
Reply
Like
0
Nevron Support
Nevron Support
posted 4 Years Ago
ANSWER
Post Details
Group: Administrators
Posts: 3.1K,
Visits: 4.1K
Hello
,
Please
take
a
look
at
the
following
documentation
topic
for
information
how
to
customize
and
remove
commands
from
the
NOV
Diagram
command
bar
'
s
UI
:
NOV
Diagram
Command
Bars
If
you
decide
to
use
the
ribbon
,
you
can
also
use
the
WinForms
designer
to
hide
commands
or
ribbon
tabs
:
NOV
Diagram
Ribbon
Let
us
know
if
you
have
any
questions
.
Best Regards,
Nevron Support Team
Reply
Like
0
Ashley Davy
Ashley Davy
posted 4 Years Ago
ANSWER
Post Details
Group: Forum Members
Posts: 36,
Visits: 119
How
do
I
access
the
ToolBarBuilders
and
the
MenuDropDownBuilders
from
the
NDrawingViewWithCommandBarsControl
?&
nbsp
; &
nbsp
;
I
cannot
find
where
these
are
accessible
from
the
NDrawingViewWithCommandBarsControl
.&
nbsp
;
Also
how
do
I
get
the
&
nbsp
;
NCommandBarUIBuilder
&
nbsp
;
that
is
associated
with
my
NDrawingViewWithCommandBarsControl
that
is
on
my
form
?
The
help
file
says
the
following
:
Modifying
Builder
CollectionsIf
you
want
to
remove
a
given
toolbar
or
menu
from
the
builders
,
you
can
easily
do
so
by
using
the
&
nbsp
;
Remove
&
nbsp
;
method
of
the
&
nbsp
;
ToolBarBuilders
&
nbsp
;
and
&
nbsp
;
MenuDropDownBuilders
&
nbsp
;
collection
of
the
diagram
command
bar
builder
respectively
.
You
can
get
or
remove
builders
by
name
.
The
names
of
all
&
nbsp
;
diagram
menu
and
toolbar
builders
are
exposed
as
constants
in
the
&
nbsp
;
NDiagramCommandBarBuilder
&
nbsp
;
class
.&
nbsp
;
For
example
,
to
remove
the
&
nbsp
;"
File
"
menu
and
the
"
Standard
"
toolbar
of
a
command
bars
based
diagram
UI
,
you
can
use
the
following
piece
of
code
:
Remove
Toolbar
and
Menu
Builders
Copy
Code
commandBarBuilder
.
MenuDropDownBuilders
.
Remove
(
NDiagramCommandBarBuilder
.
MenuFileName
);
commandBarBuilder
.
ToolBarBuilders
.
Remove
(
NDiagramCommandBarBuilder
.
ToolbarStandardName
);
In
order
to
add
or
insert
your
own
toolbar
or
menu
drop
down
builder
,
you
can
use
the
&
nbsp
;
Add
&
nbsp
;
or
&
nbsp
;
Insert
&
nbsp
;
methods
of
the
corresponding
builder
collection
respectively
.
Add
Custom
Toolbar
and
Menu
Builders
Copy
Code
commandBarBuilder
.
MenuDropDownBuilders
.
Insert
(
1
,
new
CustomMenuBuilder
());
commandBarBuilder
.
ToolBarBuilders
.
Insert
(
0
,
new
CustomToolBarBuilder
());
Reply
Like
0
Nevron Support
Nevron Support
posted 4 Years Ago
ANSWER
Post Details
Group: Administrators
Posts: 3.1K,
Visits: 4.1K
Hello
,
If
you
are
using
the
WinForms
designer
and
the
NDrawingViewWithCommandBars
controls
,
it
'
s
not
possible
to
access
the
command
builders
,
because
they
already
have
built
the
commanding
UI
.
To
access
and
modify
the
command
bar
builders
,
create
the
drawing
view
and
the
commanding
UI
via
code
by
using
the
NDiagramCommandBarBuilder
class
.
The
sample
code
below
creates
a
drawing
view
,
then
creates
a
command
bar
UI
around
it
using
the
NDiagramCommandBarBuilder
class
and
removes
the
View
menu
and
the
View
toolbar
builders
.
C
#
Code
NDrawingView
drawingView
=
new
NDrawingView
();
NDiagramCommandBarBuilder
builder
=
new
NDiagramCommandBarBuilder
();
builder
.
MenuDropDownBuilders
.
Remove
(
NDiagramCommandBarBuilder
.
MenuViewName
);
builder
.
ToolBarBuilders
.
Remove
(
NDiagramCommandBarBuilder
.
ToolbarViewName
);
NWidget
commandBarUI
=
builder
.
CreateUI
(
drawingView
);
NNovWidgetHost
&
lt
;
NWidget
&
gt
;
host
=
new
NNovWidgetHost
&
lt
;
NWidget
&
gt
;(
commandBarUI
);
host
.
Dock
=
DockStyle
.
Fill
;
Controls
.
Add
(
host
);
Visual
Basic
Code
Dim
drawingView
As
NDrawingView
=
New
NDrawingView
()
Dim
builder
As
NDiagramCommandBarBuilder
=
New
NDiagramCommandBarBuilder
()
builder
.
MenuDropDownBuilders
.
Remove
(
NDiagramCommandBarBuilder
.
MenuViewName
)
builder
.
ToolBarBuilders
.
Remove
(
NDiagramCommandBarBuilder
.
ToolbarViewName
)
Dim
commandBarUI
As
NWidget
=
builder
.
CreateUI
(
drawingView
)
Dim
host
As
NNovWidgetHost
(
Of
NWidget
) =
New
NNovWidgetHost
(
Of
NWidget
)(
commandBarUI
)
host
.
Dock
=
DockStyle
.
Fill
Controls
.
Add
(
host
)
Best Regards,
Nevron Support Team
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Similar Topics
Post Quoted Reply
Reading This Topic
1 active, 1 guest, 0 members, 0 anonymous
No members currently viewing this topic!
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search