# Problem using the Map in a TabControl

**URL:** <https://community.thinkgeo.com/t/problem-using-the-map-in-a-tabcontrol/1069>\
**Category:** WinForms\
**Created:** [February 24, 2010, 6:21am UTC](https://community.thinkgeo.com/t/problem-using-the-map-in-a-tabcontrol/1069 "2010-02-24T06:21:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krypton](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/977dab/32.png) [@Krypton](https://community.thinkgeo.com/u/Krypton)\
**Post date:** [February 24, 2010, 6:21am UTC](https://community.thinkgeo.com/t/problem-using-the-map-in-a-tabcontrol/1069/1 "2010-02-24T06:21:22Z")

</div>

Hello

&nbsp;

I&nbsp;am&nbsp;using&nbsp;the&nbsp;winformsMap&nbsp;in&nbsp;a&nbsp;tabControl,

on&nbsp;the&nbsp;form&nbsp;load,&nbsp;i&nbsp;am&nbsp;adding&nbsp;my&nbsp;layers&nbsp;and&nbsp;styles,

but&nbsp;the&nbsp;map&nbsp;is&nbsp;not&nbsp;showing&nbsp;until&nbsp;i&nbsp;pan&nbsp;or&nbsp;zoom&nbsp;or&nbsp;call&nbsp;the&nbsp;refresh

I&nbsp;think&nbsp;that&nbsp;the&nbsp;problem&nbsp;is&nbsp;because&nbsp;of&nbsp;the&nbsp;HandleCreated&nbsp;event&nbsp;on&nbsp;TabControl&nbsp;which&nbsp;is&nbsp;not&nbsp;called&nbsp;till&nbsp;you&nbsp;open&nbsp;the&nbsp;specified&nbsp;Tab

Can&nbsp;you&nbsp;give&nbsp;me&nbsp;a&nbsp;solution,&nbsp;or&nbsp;this&nbsp;is&nbsp;problem&nbsp;that&nbsp;i&nbsp;wish&nbsp;to&nbsp;take&nbsp;it&nbsp;in&nbsp;consideration

&nbsp;

Thanks.

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [February 24, 2010, 7:47pm UTC](https://community.thinkgeo.com/t/problem-using-the-map-in-a-tabcontrol/1069/2 "2010-02-24T19:47:16Z")

</div>

Krypton,

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

I&nbsp;try&nbsp;to&nbsp;recreate&nbsp;your&nbsp;problem,&nbsp;so&nbsp;I&nbsp;create&nbsp;a&nbsp;simple&nbsp;sample,&nbsp;it&nbsp;works&nbsp;fine.&nbsp;Can&nbsp;you&nbsp;download&nbsp;it&nbsp;and&nbsp;test&nbsp;in&nbsp;your&nbsp;environment?

By&nbsp;the&nbsp;way,&nbsp;our&nbsp;HowDoI&nbsp;samples&nbsp;also&nbsp;use&nbsp;the&nbsp;map&nbsp;in&nbsp;the&nbsp;tabControl,&nbsp;it&nbsp;works&nbsp;fine&nbsp;too.

Thanks

James

[1819-TestUsingMapInTabControl.zip](https://community.thinkgeo.com/uploads/default/original/2X/a/aa2564851d99dc501f0af17e052a3aa045480db7.zip) (10.6 KB)

---

<div class="post-metadata">

**Author:** ![Krypton](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/k/977dab/32.png) [@Krypton](https://community.thinkgeo.com/u/Krypton)\
**Post date:** [February 25, 2010, 5:29am UTC](https://community.thinkgeo.com/t/problem-using-the-map-in-a-tabcontrol/1069/3 "2010-02-25T05:29:08Z")

</div>

OK,&nbsp;I&nbsp;will&nbsp;try&nbsp;it&nbsp;and&nbsp;regenerate&nbsp;my&nbsp;situation&nbsp;  
&nbsp;&nbsp;  
&nbsp;thanks

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [February 25, 2010, 3:08pm UTC](https://community.thinkgeo.com/t/problem-using-the-map-in-a-tabcontrol/1069/4 "2010-02-25T15:08:16Z")

</div>

I&nbsp;let&nbsp;you&nbsp;know&nbsp;that&nbsp;I&nbsp;also&nbsp;tested&nbsp;the&nbsp;attached&nbsp;sample&nbsp;in&nbsp;my&nbsp;environment&nbsp;and&nbsp;I&nbsp;did&nbsp;not&nbsp;encounter&nbsp;any&nbsp;problem.&nbsp;I&nbsp;hope&nbsp;that&nbsp;this&nbsp;is&nbsp;working&nbsp;for&nbsp;you&nbsp;too&nbsp;now.
