# Controlling a Newline and Window Size of TaskDialog (in Japanese)

**URL:** <https://forum.dynamobim.com/t/controlling-a-newline-and-window-size-of-taskdialog-in-japanese/97413>\
**Category:** Revit\
**Tags:** revit, python\
**Created:** [January 23, 2024, 7:16am UTC](https://forum.dynamobim.com/t/controlling-a-newline-and-window-size-of-taskdialog-in-japanese/97413 "2024-01-23T07:16:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![csys17014](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/csys17014/32/181312_2.png) [@csys17014](https://forum.dynamobim.com/u/csys17014)\
**Post date:** [January 23, 2024, 7:16am UTC](https://forum.dynamobim.com/t/controlling-a-newline-and-window-size-of-taskdialog-in-japanese/97413/1 "2024-01-23T07:16:45Z")

</div>

Hello, Dynamo fellows.

I have shown myself here to ask you whether there is the way to control the newlines and window sizes used in the TaskDialog widnow.

Thankfully, he @Konrad_K_Sobon showed a simple instruction of constructing TaskDialog with typical methods of RevitAPI.  
[**How to Construct a TaskDialog?**](https://forum.dynamobim.com/t/how-to-construct-a-taskdialog/23550/2)

Whereas I am struggling with newlines and window sizes (prbly, newlines would be solved by ‘/n’?).  
I could not find “window sizes(height/width)” or this sort of things in the member(property).  
Could you guys lend hands for me?

The code I modified differentiates from his when it comes to **character** (Japanese).  
I executed my command with:

```auto
import clr
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *

dialog = TaskDialog("日本語タイトル which means 'a Japanese Title'")
dialog.MainInstruction = "ここにメインインストラクションを記載していますが、改行とダイアログのウィンドウの高さや幅を調整できないでしょうか。 which means 'I put a main instruction here and I would like to adjust the newlines and the window's height and width of a TaskDialog.'"
dialog.MainContent = "右下の「OK」ボタンを押してください。 which means 'click the 'OK' right down below.'"

dialog.CommonButtons = TaskDialogCommonButtons.Ok;
dialog.DefaultButton = TaskDialogResult.Ok;

dialog.Show()

#Assign your output to the OUT variable.
OUT = dialog

```

and the result is:

 ![TaskDialog_JPN](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/b/bbc640a325179e167e385498ee1d2a08e0e8a51f.png)

---

<div class="post-metadata">

**Author:** ![Brendan\_Cassidy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/brendan_cassidy/32/7685_2.png) [@Brendan\_Cassidy](https://forum.dynamobim.com/u/Brendan_Cassidy)\
**Post date:** [January 23, 2024, 8:28am UTC](https://forum.dynamobim.com/t/controlling-a-newline-and-window-size-of-taskdialog-in-japanese/97413/2 "2024-01-23T08:28:16Z")

</div>

To add a new line within a string in python you need to add “\n” within the text.

It would seem you cannot control the width/height of the taskdialog box that is generated within revit using this([TaskDialog Members](https://www.revitapidocs.com/2024/14095041-907b-835f-a853-8a88895a9339.htm)).

If you utilised the “DataShapes” Dynamo package this does allow you to, and there is further guidance on this on the forum within other posts.

---

<div class="post-metadata">

**Author:** ![csys17014](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/csys17014/32/181312_2.png) [@csys17014](https://forum.dynamobim.com/u/csys17014)\
**Post date:** [January 23, 2024, 10:16am UTC](https://forum.dynamobim.com/t/controlling-a-newline-and-window-size-of-taskdialog-in-japanese/97413/3 "2024-01-23T10:16:49Z")

</div>

Thanks for your advice.  
Duly noted.
