StrokeStyle Issue


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi,

The code you have posted should update the stroke style of all currently selected shapes. If you have only one shape selected, only it will be updated. Do you want to achieve something else? If yes, please elaborate.

One suggestion regarding your code is to use oNode.Style.StrokeStyle instead of ComposeStrokeStyle() in the Else clause of your loop's If statement as this is the correct way to get the local stroke style of the shape for modification.



Best Regards,
Nevron Support Team


Thunis Kruger
Thunis Kruger
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)
Group: Forum Members
Posts: 6, Visits: 1

Hi Support,

The sub below set the style for all the shapes on the NDocument. How do I set the style for the selected Shape only?

 

Private Sub SetStyleForLine()

If bInit = True Then Exit Sub

For Each oNode As NShape In View.Selection.Nodes

Dim oStrokeStyle As NStrokeStyle

If oNode.Style Is Nothing AndAlso oNode.Style.StrokeStyle Is Nothing Then

Continue For

Else

oStrokeStyle = oNode.ComposeStrokeStyle

End If

oStrokeStyle.Color = colorComb.SelectedColor

oStrokeStyle.Width = New NLength(CSng(NewLineWidth.Value))

oNode.Style.StrokeStyle = oStrokeStyle

Next

View.SmartRefresh()

End Sub

 

Thanks Thunis


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search