# Htmlviewer in a new window

**URL:** <https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889>\
**Category:** General\
**Created:** [January 10, 2022, 4:22pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889 "2022-01-10T16:22:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_Hendriksen](https://forum.xojo.com/user_avatar/forum.xojo.com/frank_hendriksen/32/6388_2.png) [@Frank\_Hendriksen](https://forum.xojo.com/u/Frank_Hendriksen)\
**Post date:** [January 10, 2022, 4:22pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/1 "2022-01-10T16:22:35Z")

</div>

I have a window1 with texfield1, containing a local index.html file.  
Now I want to open a window2 with a htmlviewer opening textfield1. How can I do that?.

---

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [January 10, 2022, 5:15pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/2 "2022-01-10T17:15:33Z")

</div>

Have a look at [http://documentation.xojo.com/api/user\_interface/desktop/desktophtmlviewer.html.LoadPage](http://documentation.xojo.com/api/user_interface/desktop/desktophtmlviewer.html.LoadPage)

---

<div class="post-metadata">

**Author:** ![Frank\_Hendriksen](https://forum.xojo.com/user_avatar/forum.xojo.com/frank_hendriksen/32/6388_2.png) [@Frank\_Hendriksen](https://forum.xojo.com/u/Frank_Hendriksen)\
**Post date:** [January 10, 2022, 5:36pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/3 "2022-01-10T17:36:03Z")

</div>

I did, but the shown code gives me errors.

---

<div class="post-metadata">

**Author:** ![TimStreater](https://forum.xojo.com/user_avatar/forum.xojo.com/timstreater/32/586_2.png) [@TimStreater](https://forum.xojo.com/u/TimStreater)\
**Post date:** [January 10, 2022, 5:59pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/4 "2022-01-10T17:59:53Z")

</div>

I takeit you’ve created Window1 and Window2 in the IDE, and given the first one some html in a TextArea, and the second an htmlviewer?

Then add a button to to window1, and in its Pressed event add something like:

```auto
Window2.show ()
window2.LoadPage (window1.mytextarea.text)

```

IIRC this does not work on Windows, so you’ll have to do something different there.

---

<div class="post-metadata">

**Author:** ![Frank\_Hendriksen](https://forum.xojo.com/user_avatar/forum.xojo.com/frank_hendriksen/32/6388_2.png) [@Frank\_Hendriksen](https://forum.xojo.com/u/Frank_Hendriksen)\
**Post date:** [January 10, 2022, 6:26pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/5 "2022-01-10T18:26:06Z")

</div>

I now get the error Window1.PushButton4.Open, line 2  
Type “Window2.Window2” has no member named “Loadpage”  
window2.Loadpage (window1.textfield2)

---

<div class="post-metadata">

**Author:** ![Matthew\_Combatti](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_combatti/32/635_2.png) [@Matthew\_Combatti](https://forum.xojo.com/u/Matthew_Combatti)\
**Post date:** [January 10, 2022, 6:34pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/6 "2022-01-10T18:34:19Z")

</div>

Place an HTMLViewer on Window2, then call Window2.HTMLViewerName.LoadPage()

---

<div class="post-metadata">

**Author:** ![TimStreater](https://forum.xojo.com/user_avatar/forum.xojo.com/timstreater/32/586_2.png) [@TimStreater](https://forum.xojo.com/u/TimStreater)\
**Post date:** [January 10, 2022, 6:52pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/7 "2022-01-10T18:52:17Z")

</div>

Yeah sorry, forgot to add that bit.

---

<div class="post-metadata">

**Author:** ![Frank\_Hendriksen](https://forum.xojo.com/user_avatar/forum.xojo.com/frank_hendriksen/32/6388_2.png) [@Frank\_Hendriksen](https://forum.xojo.com/u/Frank_Hendriksen)\
**Post date:** [January 10, 2022, 7:24pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/8 "2022-01-10T19:24:51Z")

</div>

Still not working  
Window1.Button1.Pressed, line 2  
There is more than one method with this name but this does not match any of the available signatures.  
window2.htmlviewer1.LoadPage (window1.textfield1.text)

---

<div class="post-metadata">

**Author:** ![TimStreater](https://forum.xojo.com/user_avatar/forum.xojo.com/timstreater/32/586_2.png) [@TimStreater](https://forum.xojo.com/u/TimStreater)\
**Post date:** [January 10, 2022, 7:27pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/9 "2022-01-10T19:27:44Z")

</div>

> [@Frank\_Hendriksen](#):
>
> `window2.htmlviewer1.LoadPage (window1.textfield1.text)`

Try:  
`window2.htmlviewer1.LoadPage (window1.textfield1.text, Nil)`

---

<div class="post-metadata">

**Author:** ![Matthew\_Combatti](https://forum.xojo.com/user_avatar/forum.xojo.com/matthew_combatti/32/635_2.png) [@Matthew\_Combatti](https://forum.xojo.com/u/Matthew_Combatti)\
**Post date:** [January 10, 2022, 7:34pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/10 "2022-01-10T19:34:21Z")

</div>

Try the attached demo - just threw it together and know it works 🙂  
\*\*Because Window2 is an implicit instance, you do not need to call window2.show. Since HTMLViewer is an object of an implicit window, it will automatically open the window when invoking the HTMLViewer.LoadPage method.

---

<div class="post-metadata">

**Author:** ![Frank\_Hendriksen](https://forum.xojo.com/user_avatar/forum.xojo.com/frank_hendriksen/32/6388_2.png) [@Frank\_Hendriksen](https://forum.xojo.com/u/Frank_Hendriksen)\
**Post date:** [January 10, 2022, 7:47pm UTC](https://forum.xojo.com/t/htmlviewer-in-a-new-window/67889/11 "2022-01-10T19:47:19Z")

</div>

This works. Thanks
