Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem with header selection (Read 1564 times)
Samun
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Jul 3rd, 2007
Problem with header selection
Mar 24th, 2008 at 7:04pm
Print Post  
I am trying to select a header so that the user has the possibility to change the header title (after all, he might have made a mistake). However, I am unable to get the header object, I always get "nothing" as the header. Please find below my code. Hopefully you can tell me what I am doing wrong?

    Private Sub DiagramView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DiagramView1.MouseDoubleClick
       Dim grid As Grid = Me.FlowChart1.LaneGrid
       Dim cellBounds1 As RectangleF = RectangleF.Empty
       Dim Mousepoint As PointF = New PointF(e.X, e.Y)

       Dim ThisHeader As Header = grid.GetHeaderFromPoint(Mousepoint, cellBounds1)
       If ThisHeader Is Nothing Then
           MsgBox("No Header selected!")
       Else
           MsgBox(ThisHeader.Title & " selected! - Row: " & grid.GetRowIndex(ThisHeader))
       End If

    End Sub
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with header selection
Reply #1 - Mar 24th, 2008 at 8:08pm
Print Post  
Either handle the Diagram.DoubleClicked event which gives you the mouse position in document coordinates, or from the DiagramView handler call ClientToDoc to convert from pixels to document coordinates (millimeters by default).
  
Back to top
 
IP Logged
 
Samun
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Jul 3rd, 2007
Re: Problem with header selection
Reply #2 - Mar 24th, 2008 at 10:30pm
Print Post  
Thank you, Stoyo, I did not realize that it was simply a matter of the units...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint