MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




How to change line thickness and color

This is a discussion on How to change line thickness and color within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Eric, How do you change line thickness and color when you call Addshape to draw different line thickness, color of ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  4 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 12-09-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
How to change line thickness and color

Eric,

How do you change line thickness and color when you call Addshape to draw different line thickness, color of circles and rectangles?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 12-09-2003
Junior Member
Yellow Belt
 
Join Date: Dec 2003
Posts: 12
Here is code from an addin where a shape has been selected before the addin is called:

Code:
       Set objShape = objMap.Selection
       objShape.Line.ForeColor = vbRed
you can use the .weight property to change the thickness.

sthurlock
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 12-10-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
What is the type of objShape?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 12-10-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
It's a shape object.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 12-10-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Hi there,

I tried this, but I run into runtime error. It is because the objshape has not been set or added. Can you select the shape before it has been added to the map?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 12-10-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
This is my code:

Dim objmap As MapPointCtl.Map
Dim objloc As MapPointCtl.Location
Dim objshape As MapPointCtl.Shape

Set objmap = Me.MappointControl1.ActiveMap
Set objloc = objmap.GetLocation(wp0.lat, wp0.lon)

Set objshape = objmap.Selection
objshape.line.ForeColor = color
objshape.line.Weight = 1
objmap.Shapes.AddShape geoShapeRadius, objloc, 0.001, 0.001
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 12-11-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
I need to change the color and thickness of the line that I just added to the map. How can I do it? The following code does not work because nothing has been selected. Thanks.

'Add a Line from one location to the other
objmap.Shapes.AddLine objloc0, objloc1

Set objshape = objmap.Selection
objshape.line.ForeColor = color
objshape.line.Weight = 1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 12-11-2003
Junior Member
Yellow Belt
 
Join Date: Dec 2003
Posts: 12
Sorry I wasn't more clear. The code I gave before was from an addin that was called after the user had created and then selected a shape. In your code, you don't need to select it, you just need to grab the reference to the Shape object that is returned when you do the addline, then change the properties:


Code:
 
Set objshape = objmap.Shapes.AddLine objloc0, objloc1 
objshape.line.ForeColor = color 
objshape.line.Weight = 1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 12-12-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Thank you, sthurlock. I will try this.

Can you do the same thing if it is Autoshape (eg.rectangle, circle) instead of Shapes.AddLine?

Thank you very much.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 12-12-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Yes, when you have a method that returns a shape object, you can save the reference to that object and then change its properties.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/how-change-line-thickness-color-2208.html

Posted By For Type Date
Need Jewelry Retailer Info? This thread Refback 03-27-2007 07:13 AM
Computer Game Cheats This thread Refback 03-26-2007 11:30 AM
Find Latest Tamil Songs Mp3 Here. This thread Refback 03-25-2007 08:09 PM
Car Insurance Providers Information. This thread Refback 03-24-2007 09:48 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Change color of arrow Shragel MapPoint 2006/2009 Discussion 3 07-12-2006 07:28 PM
Change Background Color of Map wadams MapPoint 2006/2009 Discussion 3 06-05-2006 09:34 AM
Mappoint 2004 Line thickness problem ? Danny MapPoint 2006/2009 Discussion 1 05-30-2005 12:27 PM
Change color of Text Balloon Anonymous MapPoint 2006/2009 Discussion 2 05-17-2004 07:26 AM
Can I change the color of the over-all map? We wa.... Anonymous MapPoint 2006/2009 Discussion 1 08-29-2000 12:56 PM


All times are GMT -5. The time now is 03:54 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5
MP2K Magazine
Visitor Map

Stansted Flights
Stansted flights are great value when you book with Holiday Hypermarket. You can find plenty of information about destinations and even UK airports online at Holiday Hypermarket.

Flights to Greece
Find cheap flights to Greece on Travel Counsellors. A personal Travel Counsellor can help you plan flights and find accommodation in Greece.

Flight
When looking to jet set off, make sure you check out dealchecker.co.uk before you check in anywhere else. Bag a bargain flight from all major scheduled and charter airlines.

Sri Lanka Holidays
There are some outstanding deals on Sri Lanka holidays at theholidayplace.co.uk. Sri Lanka is renowned for it's exceptional beauty! Book a holiday today!

Balearics
Before booking to the Balearics Islands make sure you check out our travel guide online. The Balearics are renowned for their vibrant nightlife but there are also some stunning Gothic cathedrals, Stone Age ruins and fishing villages.

Price Comparisons
Search and compare millions of holidays, flights and hotels etc. At Travel.co.uk, price comparisons are easy.

Holidays in Fuerteventura
Need a break? Go to the Canary Islands! Find information on holidays in Fuerteventura at On The Beach.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51