User (Legacy) Posted September 6, 2006 Report Share Posted September 6, 2006 I want to give users the ability to click on a state on the U.S. map then drill down to the zipcode map for that state. The documentation is vague on how to do this, and the code samples all seem to be in C sharp rather than VB. Can someone please provide me with the VB code to do this? Thanks, Paul Link to comment Share on other sites More sharing options...
User (Legacy) Posted September 7, 2006 Author Report Share Posted September 7, 2006 Nevermind, I figured it out.. For anyone who wants to know here's what I did: Private Sub Chart1_MouseUp(ByVal sender As System.Object, ByVal e As ChartFX.WinForms.HitTestEventArgs) Handles Chart1.MouseUp Dim strStateAbb As String Dim strMapSource As String If Not (e.Object.datatext) Is DBNull.Value Then strStateAbb = e.Object.datatext.ToString() Chart1.Visible = False strMapSource = "US\\Counties\\" & strStateAbb & " Counties.svg" Map2.MapSource = strMapSource Chart2.Visible = True End If End Sub "Paul O'Mara" <pomara@pes-it.com> wrote in message news:6aqs1de0GHA.2084@webserver3.softwarefx.com... >I want to give users the ability to click on a state on the U.S. map then >drill down to the zipcode map for that state. The documentation is vague on >how to do this, and the code samples all seem to be in C sharp rather than >VB. > > Can someone please provide me with the VB code to do this? > > Thanks, > Paul > Link to comment Share on other sites More sharing options...
User (Legacy) Posted September 11, 2006 Author Report Share Posted September 11, 2006 Ok, now I am getting an error when I try to move the slide bar in the datagrid section of the map. Here is the error message I receive: "Public member 'datatext' on type 'DataGrid' not found" Here is the statement that it is hanging on during the MouseUp event: If Not (e.Object.datatext) Is DBNull.Value Then DrillDownMap(e.Object.datatext.ToString) cboState.SelectedValue = e.Object.datatext.ToString End If I think I need some way to check and make sure that the user has clicked on a state in the map before evaluating e.Object.datatext. Any help would be greatly appreciated. -Paul "Paul O'Mara" <pomara@pes-it.com> wrote in message news:LWWWMjs0GHA.3960@webserver3.softwarefx.com... > Nevermind, I figured it out.. > > For anyone who wants to know here's what I did: > > Private Sub Chart1_MouseUp(ByVal sender As System.Object, ByVal e As > ChartFX.WinForms.HitTestEventArgs) Handles Chart1.MouseUp > > Dim strStateAbb As String > > Dim strMapSource As String > > If Not (e.Object.datatext) Is DBNull.Value Then > > strStateAbb = e.Object.datatext.ToString() > > Chart1.Visible = False > > strMapSource = "US\\Counties\\" & strStateAbb & " Counties.svg" > > Map2.MapSource = strMapSource > > Chart2.Visible = True > > End If > > End Sub > > > > "Paul O'Mara" <pomara@pes-it.com> wrote in message > news:6aqs1de0GHA.2084@webserver3.softwarefx.com... >>I want to give users the ability to click on a state on the U.S. map then >>drill down to the zipcode map for that state. The documentation is vague >>on how to do this, and the code samples all seem to be in C sharp rather >>than VB. >> >> Can someone please provide me with the VB code to do this? >> >> Thanks, >> Paul >> > > Link to comment Share on other sites More sharing options...
Software FX Posted September 13, 2006 Report Share Posted September 13, 2006 Ok what is going on here is you are recieving the MouseUP event EVERY time you press the mouse and release. In your case not ALWAYS is e.Object a MapRegion It could be a MouseUp event from the Datagrid OR e.Object could be null. You would not get this problem in C# because it would force you cast e.Object to a type that has a MapRegion, otherwise it would not compile. In your case you need to check if e.Object really is a MapRegion and only if it is ask for the DataText property. How to do this in VB.NET .... let me check...Found It! TypeOf e.Object Is MapRegion In your case I would guess that you want to just ignore the MouseUp event when the object is NOT a MapRegion. Hope this helps. -c "Paul O'Mara" <pomara@pes-it.com> wrote in message news:sCQm18d1GHA.3720@webserver3.softwarefx.com... > Ok, now I am getting an error when I try to move the slide bar in the > datagrid section of the map. Here is the error message I receive: > > "Public member 'datatext' on type 'DataGrid' not found" > > Here is the statement that it is hanging on during the MouseUp event: > > If Not (e.Object.datatext) Is DBNull.Value Then > > DrillDownMap(e.Object.datatext.ToString) > > cboState.SelectedValue = e.Object.datatext.ToString > > End If > > > I think I need some way to check and make sure that the user has clicked > on a state in the map before evaluating e.Object.datatext. > > Any help would be greatly appreciated. > > -Paul > > > > "Paul O'Mara" <pomara@pes-it.com> wrote in message > news:LWWWMjs0GHA.3960@webserver3.softwarefx.com... >> Nevermind, I figured it out.. >> >> For anyone who wants to know here's what I did: >> >> Private Sub Chart1_MouseUp(ByVal sender As System.Object, ByVal e As >> ChartFX.WinForms.HitTestEventArgs) Handles Chart1.MouseUp >> >> Dim strStateAbb As String >> >> Dim strMapSource As String >> >> If Not (e.Object.datatext) Is DBNull.Value Then >> >> strStateAbb = e.Object.datatext.ToString() >> >> Chart1.Visible = False >> >> strMapSource = "US\\Counties\\" & strStateAbb & " Counties.svg" >> >> Map2.MapSource = strMapSource >> >> Chart2.Visible = True >> >> End If >> >> End Sub >> >> >> >> "Paul O'Mara" <pomara@pes-it.com> wrote in message >> news:6aqs1de0GHA.2084@webserver3.softwarefx.com... >>>I want to give users the ability to click on a state on the U.S. map then >>>drill down to the zipcode map for that state. The documentation is vague >>>on how to do this, and the code samples all seem to be in C sharp rather >>>than VB. >>> >>> Can someone please provide me with the VB code to do this? >>> >>> Thanks, >>> Paul >>> >> >> > > Link to comment Share on other sites More sharing options...
User (Legacy) Posted September 15, 2006 Author Report Share Posted September 15, 2006 That seems to have done the trick! Thanks! "SoftwareFX Support" <support@softwarefx.com> wrote in message news:9QstaDz1GHA.3152@webserver3.softwarefx.com... > Ok what is going on here is you are recieving the MouseUP event EVERY time > you press the mouse and release. > In your case not ALWAYS is e.Object a MapRegion > It could be a MouseUp event from the Datagrid OR e.Object could be null. > You would not get this problem in C# because it would force you cast > e.Object to a type that has a MapRegion, otherwise it would not compile. > In your case you need to check if e.Object really is a MapRegion and only > if it is ask for the DataText property. > > How to do this in VB.NET .... let me check...Found It! > TypeOf e.Object Is MapRegion > > In your case I would guess that you want to just ignore the MouseUp event > when the object is NOT a MapRegion. > > Hope this helps. > > -c > > > > "Paul O'Mara" <pomara@pes-it.com> wrote in message > news:sCQm18d1GHA.3720@webserver3.softwarefx.com... >> Ok, now I am getting an error when I try to move the slide bar in the >> datagrid section of the map. Here is the error message I receive: >> >> "Public member 'datatext' on type 'DataGrid' not found" >> >> Here is the statement that it is hanging on during the MouseUp event: >> >> If Not (e.Object.datatext) Is DBNull.Value Then >> >> DrillDownMap(e.Object.datatext.ToString) >> >> cboState.SelectedValue = e.Object.datatext.ToString >> >> End If >> >> >> I think I need some way to check and make sure that the user has clicked >> on a state in the map before evaluating e.Object.datatext. >> >> Any help would be greatly appreciated. >> >> -Paul >> >> >> >> "Paul O'Mara" <pomara@pes-it.com> wrote in message >> news:LWWWMjs0GHA.3960@webserver3.softwarefx.com... >>> Nevermind, I figured it out.. >>> >>> For anyone who wants to know here's what I did: >>> >>> Private Sub Chart1_MouseUp(ByVal sender As System.Object, ByVal e As >>> ChartFX.WinForms.HitTestEventArgs) Handles Chart1.MouseUp >>> >>> Dim strStateAbb As String >>> >>> Dim strMapSource As String >>> >>> If Not (e.Object.datatext) Is DBNull.Value Then >>> >>> strStateAbb = e.Object.datatext.ToString() >>> >>> Chart1.Visible = False >>> >>> strMapSource = "US\\Counties\\" & strStateAbb & " Counties.svg" >>> >>> Map2.MapSource = strMapSource >>> >>> Chart2.Visible = True >>> >>> End If >>> >>> End Sub >>> >>> >>> >>> "Paul O'Mara" <pomara@pes-it.com> wrote in message >>> news:6aqs1de0GHA.2084@webserver3.softwarefx.com... >>>>I want to give users the ability to click on a state on the U.S. map >>>>then drill down to the zipcode map for that state. The documentation is >>>>vague on how to do this, and the code samples all seem to be in C sharp >>>>rather than VB. >>>> >>>> Can someone please provide me with the VB code to do this? >>>> >>>> Thanks, >>>> Paul >>>> >>> >>> >> >> > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.