# Line borders

**URL:** <https://community.thinkgeo.com/t/line-borders/2007>\
**Category:** WinForms\
**Created:** [June 22, 2012, 2:23pm UTC](https://community.thinkgeo.com/t/line-borders/2007 "2012-06-22T14:23:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hotter](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@Hotter](https://community.thinkgeo.com/u/Hotter)\
**Post date:** [June 22, 2012, 2:23pm UTC](https://community.thinkgeo.com/t/line-borders/2007/1 "2012-06-22T14:23:38Z")

</div>

&nbsp;Is&nbsp;it&nbsp;possible&nbsp;to&nbsp;create&nbsp;LineStyle&nbsp;with&nbsp;a&nbsp;border&nbsp;when&nbsp;Line&nbsp;is&nbsp;with&nbsp;dashes?

---

<div class="post-metadata">

**Author:** ![Clint](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@Clint](https://community.thinkgeo.com/u/Clint)\
**Post date:** [June 22, 2012, 2:55pm UTC](https://community.thinkgeo.com/t/line-borders/2007/2 "2012-06-22T14:55:45Z")

</div>

&nbsp;Thanks&nbsp;you&nbsp;for&nbsp;your&nbsp;post.

&nbsp;  
Yes&nbsp;it's&nbsp;possible&nbsp;to&nbsp;create&nbsp;a&nbsp;line&nbsp;style&nbsp;with&nbsp;a&nbsp;variety&nbsp;of&nbsp;different&nbsp;dash&nbsp;patterns.&nbsp;&nbsp;The&nbsp;easiest&nbsp;way&nbsp;is&nbsp;to&nbsp;set&nbsp;the&nbsp;DashStyle&nbsp;property&nbsp;on&nbsp;the&nbsp;geopen&nbsp;you&nbsp;are&nbsp;using&nbsp;in&nbsp;your&nbsp;linestyle.&nbsp;&nbsp;Here&nbsp;is&nbsp;a&nbsp;list&nbsp;of&nbsp;the&nbsp;different&nbsp;types&nbsp;of&nbsp;dashes&nbsp;Map&nbsp;Suite&nbsp;supports&nbsp;out&nbsp;of&nbsp;the&nbsp;box.  
&nbsp;  
[wiki.thinkgeo.com/wiki/Think...eDashStyle](http://wiki.thinkgeo.com/wiki/ThinkGeo.MapSuite.Core.LineDashStyle)  
&nbsp;  
Here&nbsp;is&nbsp;some&nbsp;sample&nbsp;code&nbsp;that&nbsp;shows&nbsp;how&nbsp;to&nbsp;set&nbsp;the&nbsp;Dash&nbsp;Style.  
&nbsp;  
myLineStyle.CenterPen.DashStyle&nbsp;=&nbsp;LineDashStyle.Dash;  
myLineStyle.OuterPen.DashStyle&nbsp;=&nbsp;LineDashStyle.Dash;  
myLineStyle.InnerPen.DashStyle&nbsp;=&nbsp;LineDashStyle.Dash;  
&nbsp;  
If&nbsp;these&nbsp;Dash&nbsp;Styles&nbsp;aren't&nbsp;what&nbsp;you&nbsp;are&nbsp;looking&nbsp;for&nbsp;you&nbsp;can&nbsp;also&nbsp;create&nbsp;your&nbsp;own&nbsp;Dash&nbsp;Pattern&nbsp;and&nbsp;have&nbsp;the&nbsp;map&nbsp;control&nbsp;render&nbsp;it&nbsp;however&nbsp;you&nbsp;like.&nbsp;&nbsp;For&nbsp;for&nbsp;more&nbsp;information&nbsp;check&nbsp;out:  
&nbsp;  
[wiki.thinkgeo.com/wiki/Think...ashPattern](http://wiki.thinkgeo.com/wiki/ThinkGeo.MapSuite.Core.GeoPen#DashPattern)

---

<div class="post-metadata">

**Author:** ![Hotter](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@Hotter](https://community.thinkgeo.com/u/Hotter)\
**Post date:** [June 22, 2012, 3:15pm UTC](https://community.thinkgeo.com/t/line-borders/2007/3 "2012-06-22T15:15:32Z")

</div>

&nbsp;Yes,&nbsp;but&nbsp;I&nbsp;want&nbsp;that&nbsp;all&nbsp;dashes&nbsp;would&nbsp;be&nbsp;with&nbsp;border&nbsp;color,&nbsp;for&nbsp;example&nbsp;white&nbsp;dashes&nbsp;with&nbsp;black&nbsp;border.

I&nbsp;get&nbsp;it&nbsp;like&nbsp;this,&nbsp;but&nbsp;its&nbsp;bad&nbsp; ![]()

---

<div class="post-metadata">

**Author:** ![Clint](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@Clint](https://community.thinkgeo.com/u/Clint)\
**Post date:** [June 22, 2012, 3:20pm UTC](https://community.thinkgeo.com/t/line-borders/2007/4 "2012-06-22T15:20:44Z")

</div>

In&nbsp;that&nbsp;case&nbsp;you&nbsp;would&nbsp;leave&nbsp;your&nbsp;outerpen&nbsp;alone&nbsp;and&nbsp;just&nbsp;set&nbsp;the&nbsp;dash&nbsp;style&nbsp;on&nbsp;the&nbsp;Inner&nbsp;or&nbsp;Center&nbsp;pen.&nbsp;&nbsp;You&nbsp;can&nbsp;set&nbsp;the&nbsp;color&nbsp;and&nbsp;pattern&nbsp;for&nbsp;each&nbsp;geopen&nbsp;however&nbsp;you&nbsp;like&nbsp;so&nbsp;this&nbsp;would&nbsp;give&nbsp;you&nbsp;the&nbsp;result&nbsp;of&nbsp;a&nbsp;Black&nbsp;Border&nbsp;with&nbsp;a&nbsp;white&nbsp;dash&nbsp;going&nbsp;down&nbsp;the&nbsp;center&nbsp;of&nbsp;it.

---

<div class="post-metadata">

**Author:** ![Hotter](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@Hotter](https://community.thinkgeo.com/u/Hotter)\
**Post date:** [June 22, 2012, 3:30pm UTC](https://community.thinkgeo.com/t/line-borders/2007/5 "2012-06-22T15:30:43Z")

</div>

&nbsp;I&nbsp;do&nbsp;it&nbsp;like&nbsp;this:

`LineStyle ls = new LineStyle();GeoPen InnerPen = new GeoPen(new GeoColor(255, GeoColor.SimpleColors.Black), 3);InnerPen.DashPattern.Add(5);InnerPen.DashPattern.Add(5);ls.InnerPen = InnerPen;GeoPen CenterPen = new GeoPen(new GeoColor(255, GeoColor.SimpleColors.Blue), 5);CenterPen.DashPattern.Add(5);CenterPen.DashPattern.Add(5);ls.CenterPen = CenterPen;`  
And&nbsp;get&nbsp;this:  
 ![]()  
And&nbsp;I&nbsp;want&nbsp;it&nbsp;to&nbsp;be&nbsp;like&nbsp;this:  
 ![]()  
How&nbsp;to&nbsp;fix&nbsp;my&nbsp;code?

---

<div class="post-metadata">

**Author:** ![Clint](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@Clint](https://community.thinkgeo.com/u/Clint)\
**Post date:** [July 10, 2012, 11:45am UTC](https://community.thinkgeo.com/t/line-borders/2007/6 "2012-07-10T11:45:05Z")

</div>

Having&nbsp;two&nbsp;different&nbsp;colors&nbsp;and&nbsp;spacing&nbsp;between&nbsp;the&nbsp;dashes&nbsp;is&nbsp;causing&nbsp;some&nbsp;issues&nbsp;using&nbsp;the&nbsp;regular&nbsp;line&nbsp;style.&nbsp;&nbsp;What&nbsp;I&nbsp;would&nbsp;recommend&nbsp;in&nbsp;this&nbsp;scenario&nbsp;if&nbsp;you&nbsp;need&nbsp;to&nbsp;look&nbsp;exactly&nbsp;like&nbsp;your&nbsp;image&nbsp;is&nbsp;to&nbsp;build&nbsp;a&nbsp;custom&nbsp;style.&nbsp;&nbsp;That&nbsp;way&nbsp;you&nbsp;have&nbsp;full&nbsp;control&nbsp;over&nbsp;everything&nbsp;and&nbsp;there&nbsp;is&nbsp;no&nbsp;magic&nbsp;happening&nbsp;on&nbsp;the&nbsp;dash&nbsp;pattern.&nbsp;  
&nbsp;&nbsp;  
&nbsp;There&nbsp;are&nbsp;some&nbsp;samples&nbsp;on&nbsp;the&nbsp;wiki&nbsp;for&nbsp;building&nbsp;custom&nbsp;styles&nbsp;and&nbsp;a&nbsp;video&nbsp;as&nbsp;well&nbsp;I&nbsp;believe.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks!&nbsp;

---

<div class="post-metadata">

**Author:** ![Hotter](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@Hotter](https://community.thinkgeo.com/u/Hotter)\
**Post date:** [July 15, 2012, 1:46pm UTC](https://community.thinkgeo.com/t/line-borders/2007/7 "2012-07-15T13:46:48Z")

</div>

&nbsp;&nbsp;&nbsp;I&nbsp;use&nbsp;custom&nbsp;style&nbsp;but&nbsp;in&nbsp;DrawCore()&nbsp;function&nbsp;I&nbsp;call&nbsp;ls.Draw(...)&nbsp;so&nbsp;its&nbsp;draw&nbsp;bad,&nbsp;I&nbsp;dont&nbsp;know&nbsp;how&nbsp;to&nbsp;make&nbsp;my&nbsp;own&nbsp;Draw&nbsp;function.

---

<div class="post-metadata">

**Author:** ![Clint](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@Clint](https://community.thinkgeo.com/u/Clint)\
**Post date:** [July 17, 2012, 3:03pm UTC](https://community.thinkgeo.com/t/line-borders/2007/8 "2012-07-17T15:03:21Z")

</div>

&nbsp;The&nbsp;DrawCore&nbsp;is&nbsp;where&nbsp;you&nbsp;will&nbsp;put&nbsp;your&nbsp;code&nbsp;in&nbsp;your&nbsp;custom&nbsp;style.&nbsp;&nbsp;I&nbsp;would&nbsp;recommend&nbsp;you&nbsp;watch&nbsp;the&nbsp;video&nbsp;and&nbsp;presentation&nbsp;named&nbsp;&nbsp;&nbsp;"Extending&nbsp;Map&nbsp;Suite:&nbsp;Creating&nbsp;Custom&nbsp;Styles"&nbsp;at&nbsp;the&nbsp;following&nbsp;link:

&nbsp;  
[gis.thinkgeo.com/Products/GI...fault.aspx](http://gis.thinkgeo.com/Products/GISComponentsforNETDevelopers/MapSuiteServicesEdition/Videos/tabid/635/Default.aspx)  
&nbsp;  
It&nbsp;will&nbsp;walk&nbsp;you&nbsp;though&nbsp;the&nbsp;steps&nbsp;of&nbsp;creating&nbsp;your&nbsp;own&nbsp;custom&nbsp;style.  
&nbsp;  
Thanks!
