Results 1 to 25 of 25

Thread: Is there any way to stop Window-Resize Animation for my Form only ?

  1. #1

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Arrow Is there any way to stop Window-Resize Animation for my Form only ?

    Is there any way to stop Window-Resize Animation for my Form only ?

    I'm changing the Form from vbMaximized/vbNormal mode to fullscreen-mode. The animation looks bad.

    VB Code:
    1. Private Sub cmdFullScreen_Click()
    2.  
    3.     If IsFullScreen Then 'change to Maximized
    4.    
    5.         RemoveTitlebar Me.hwnd ' This Sub removes titlebar at runtime
    6.         Me.WindowState = vbMaximized
    7.         IsFullScreen = False
    8.        
    9.     Else
    10.    
    11.         Titlebar False, Me.hwnd
    12.         Me.WindowState = vbNormal ' A maximized/Minimized form
    13.         '                           Can't be moved
    14.         Me.Move 0, 0, Screen.Width, Screen.Height
    15.         IsFullScreen = True
    16.    
    17.     End If
    18.  
    19. End Sub
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  2. #2

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    ~BuMp~
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  3. #3
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    you could use LockWindowUpdate I doubt it'll give you the final look you want, but it might go a smidging towards it.

    Perhaps instead of removing the titlebar/borders etc, you could subclass the WM_GETMAXMININFO message and position the window with a negative Left and Top properties depending on the GetSystemMetrics values

  4. #4

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    Thanks for your reply.
    I have some problems :

    1. Can't find any English documentation of WM_GETMAXMININFO.
    2. If I don't remove titlebar, the form doesn't fill the taskbar.
    VB Code:
    1. Me.Move 0, Me.ScaleHeight - Me.Height, _
    2.                 Screen.Width, Screen.Height * 2 ' Doesn't work
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  5. #5
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    ok, i've managed to find a solution.

    Subclassing WM_GETMINMAXINFO turned out not to work because you could set the max X < 0 or the max Y < 0 but not both at the same time (useful).

    Instead you can set the dimensions of what the window should look like when in a Normal state even when it's in a Maximized state, so it doesn't return to it's previous size it returns to one you set, which in this case will be exactly the same as the dimensions for maximized:

    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function GetWindowPlacement Lib "user32" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
    4. Private Declare Function SetWindowPlacement Lib "user32" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
    5.  
    6. Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
    7.  
    8. Private Const SM_CYCAPTION = 4
    9. Private Const SM_CXFRAME = 32
    10. Private Const SM_CYFRAME = 33
    11.  
    12. Private Type POINTAPI
    13.   x As Long
    14.   y As Long
    15. End Type
    16.  
    17. Private Type RECT
    18.   Left As Long
    19.   Top As Long
    20.   Right As Long
    21.   Bottom As Long
    22. End Type
    23.  
    24. Private Type WINDOWPLACEMENT
    25.   Length As Long
    26.   flags As Long
    27.   showCmd As Long
    28.   ptMinPosition As POINTAPI
    29.   ptMaxPosition As POINTAPI
    30.   rcNormalPosition As RECT
    31. End Type
    32.  
    33. Private m_OrigPos As WINDOWPLACEMENT
    34.  
    35. Private Sub CreateMaximizedLook()
    36.   Dim winTempPlace As WINDOWPLACEMENT
    37.  
    38.   winTempPlace.Length = Len(winTempPlace)
    39.   GetWindowPlacement Me.hwnd, winTempPlace
    40.  
    41.   With winTempPlace.rcNormalPosition
    42.     .Left = -GetSystemMetrics(SM_CXFRAME)
    43.     .Top = -GetSystemMetrics(SM_CYFRAME)
    44.     .Right = Screen.Width + GetSystemMetrics(SM_CXFRAME)
    45.     .Bottom = Screen.Height + GetSystemMetrics(SM_CYFRAME)
    46.   End With
    47.  
    48.   winTempPlace.Length = Len(winTempPlace)
    49.  
    50.   SetWindowPlacement Me.hwnd, winTempPlace
    51. End Sub
    52.  
    53. Private Sub Command1_Click()
    54.   If Me.WindowState = vbMaximized Then
    55.     CreateMaximizedLook
    56.     Me.WindowState = vbNormal
    57.   End If
    58. End Sub

    obviously you'd have to add a variable that remembers what its true Normal position is for when you want to change back, but SetWindowPlacement and GetWindowPlacement provide the solution you need

  6. #6

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    Thanks ! I tried your code. It works almost OK.
    But still 2 problems,

    First problem was with titlebar. I solved it by adding,
    .Top = -GetSystemMetrics(SM_CYFRAME) + Me.ScaleHeight - (Me.Height / Screen.TwipsPerPixelY)

    The second problem is, the tsakbar still stays on top. In case of borderless window, it goes behind the form. Any more ideas ?
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  7. #7
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    The code I supplied was meant to go with your previous code

    so if you're window is Maximized and you want it to go to fullscreen then call CreateMaximizedLook and then continue with the stuff you were doing before.

  8. #8

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    You mean I still have to remove titlebar ?

    I have merged your code into mine. If I remove titlebar, the Taskbar goes behind, but if I don't, it stays on top.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  9. #9
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    what code are you using to remove the titlebar?

  10. #10

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    VB6 Code To Remove TitleBar at Runtime

    Found it somewhere on the web. (may be in mvps.org)


    VB Code:
    1. Option Explicit
    2.  
    3. ' Win32 APIs used to toggle border styles.
    4. Private Declare Function GetWindowLong Lib "user32" _
    5.     Alias "GetWindowLongA" _
    6.         (ByVal hwnd As Long, _
    7.          ByVal nIndex As Long) As Long
    8.    
    9. Private Declare Function SetWindowPos Lib "user32" _
    10.         (ByVal hwnd As Long, _
    11.          ByVal hWndInsertAfter As Long, _
    12.          ByVal x As Long, _
    13.          ByVal y As Long, _
    14.          ByVal cx As Long, _
    15.          ByVal cy As Long, _
    16.          ByVal wFlags As Long) As Long
    17.  
    18. Private Const GWL_STYLE = (-16)
    19. Private Const WS_CAPTION = &HC00000
    20.  
    21. 'Force total pRedraw that shows new styles.
    22. Private Const SWP_FRAMECHANGED = &H20
    23. Private Const SWP_NOMOVE = &H2
    24. Private Const SWP_NOZORDER = &H4
    25. Private Const SWP_NOSIZE = &H1
    26.  
    27. '==================================================================
    28.  
    29. Private Function fStyle(mhWnd As Long, _
    30.                         Optional ByVal NewBits As Long = 0) As Long
    31.  
    32.     ' Set new style bits.
    33.     If NewBits Then
    34.         Call SetWindowLong(mhWnd, GWL_STYLE, NewBits)
    35.     End If
    36.  
    37.     ' Retrieve current style bits.
    38.     fStyle = GetWindowLong(mhWnd, GWL_STYLE)
    39.  
    40. End Function
    41.  
    42. '==================================================================
    43.  
    44. Private Sub pRedraw(mhWnd As Long)
    45.  
    46.     ' Redraw window with new style.
    47.     Const swpFlags As Long = SWP_FRAMECHANGED Or SWP_NOMOVE Or _
    48.        SWP_NOZORDER Or SWP_NOSIZE
    49.     Call SetWindowPos(mhWnd, 0, 0, 0, 0, 0, swpFlags)
    50.  
    51. End Sub
    52.  
    53. '==================================================================
    54.  
    55. Public Sub ShowTitlebar(ByVal Value As Boolean, mhWnd As Long)
    56.  
    57.     ' Set WS_CAPTION On or Off as requested.
    58.     If CBool(fStyle(mhWnd) And WS_CAPTION) And Value = False Then
    59.         'Hide the titkebar
    60.         Call fFlipBit(WS_CAPTION, Value, mhWnd)
    61.     ElseIf Not CBool(fStyle(mhWnd) And WS_CAPTION) And Value = True Then
    62.         'Show the titkebar
    63.         Call fFlipBit(WS_CAPTION, Value, mhWnd)
    64.     End If
    65.  
    66. End Sub
    67.  
    68. '==================================================================
    69.  
    70. Private Function fFlipBit(ByVal Bit As Long, _
    71.                           ByVal Value As Boolean, _
    72.                           mhWnd As Long) As Boolean
    73.  
    74.     Dim lStyle As Long
    75.     ' Retrieve current style bits.
    76.     lStyle = GetWindowLong(mhWnd, GWL_STYLE)
    77.     ' Set requested bit On or Off and Redraw.
    78.  
    79.     If Value Then
    80.         lStyle = lStyle Or Bit
    81.     Else
    82.         lStyle = lStyle And Not Bit
    83.     End If
    84.  
    85.     Call SetWindowLong(mhWnd, GWL_STYLE, lStyle)
    86.     Call pRedraw(mhWnd)
    87.     ' Return success code.
    88.     fFlipBit = (lStyle = GetWindowLong(mhWnd, GWL_STYLE))
    89.  
    90. End Function

    Edit: Someone posted this cool tip on VBF a few days ago. I couldn't find the thread.

    VB Code:
    1. Me.BorderStyle = vbBSNone
    2. [b]Me.Caption = Me.Caption[/b]
    The trick is the second statement.
    From User's point of view it doesn't change anything, but it actually forces the TitleBar to be redrawn.
    Last edited by iPrank; Jan 17th, 2007 at 02:20 AM.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  11. #11
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    ok, i've merged the two and attached it. It works ok at this end
    Attached Files Attached Files

  12. #12

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    OK. I tried your code. But it still animates when goes to fullscreen mode from maximized mode. Also, I need to go to fullscreenmode directly from normal mode too.

    I tried your original idea (LockWindowUpdate). It works perfectly in normal-to-fullscreen mode, but doesn't work in maximized-to-fullscreen mode.
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function LockWindowUpdate Lib "user32" _
    4.         (ByVal hwndLock As Long) As Long
    5.  
    6. Private Type MyRECT
    7.   Left As Long
    8.   Top As Long
    9.   Width As Long
    10.   Height As Long
    11. End Type
    12.  
    13. Private bFullScreen As Boolean
    14. Private m_NormalState As MyRECT
    15. Private LastState As VBRUN.FormWindowStateConstants
    16.  
    17. Private Sub Command1_Click()
    18.  
    19.     If Not bFullScreen Then
    20.         bFullScreen = True
    21.         LastState = Me.WindowState
    22.         LockWindowUpdate Me.hwnd
    23.         ShowTitlebar False, Me.hwnd
    24.         Me.WindowState = vbNormal
    25.         Me.Move 0, 0, Screen.Width, Screen.Height
    26.         LockWindowUpdate 0
    27.      Else
    28.         LockWindowUpdate Me.hwnd
    29.        
    30.         If LastState = vbMaximized Then
    31.             Me.WindowState = vbMaximized
    32.         Else
    33.              Me.Move m_NormalState.Left, _
    34.                m_NormalState.Top, _
    35.                m_NormalState.Width, _
    36.                m_NormalState.Height
    37.         End If
    38.        
    39.         ShowTitlebar True, Me.hwnd
    40.         LockWindowUpdate 0
    41.         bFullScreen = False
    42.     End If
    43.  
    44. End Sub
    45.  
    46. Private Sub Form_Load()
    47.  
    48.     LastState = vbNormal
    49.  
    50. End Sub
    51.  
    52. Private Sub Form_Resize()
    53.  
    54.     If Me.WindowState = vbNormal And Not bFullScreen Then
    55.         'Save normal state
    56.         m_NormalState.Top = Me.Top
    57.         m_NormalState.Height = Me.Height
    58.         m_NormalState.Left = Me.Left
    59.         m_NormalState.Width = Me.Width
    60.     End If
    61.  
    62. End Sub
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  13. #13
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    I've fiddled around with the order things, and i've got rid of the sliding that the titlebar was doing, there's still a bit of flickering though.

    For some reason there is a little delay covering up the taskbar sometimes a bit longer, perhaps waiting for some paint event.

    It's not as good as the IE fullscreen animation (or lack of it), but it's a hell of a lot better than FF
    Attached Files Attached Files

  14. #14

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    Great ! Yes. Though it is not as perfect as IE/Opera, it is much better than Fx.

    (RobDog, here is another reason to use IE )

    I found that there is a SHFullscreen API for PocketPC, but nothing for Win32.

    bushmobile, I'm using your code in my project. But I'm not making this thread resolved right now. Just in case we find a better solution.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  15. #15
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    I guess an alternative would be to create a copy your form but keep it hidden until it's in the correct position (topmost / no title / over taskbar), then just show it, and hide your original form.

  16. #16

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    That won't be possible. This application is a Text-to-Speech app (and uses a RTB).

    If the control starts reading and user presses Fullscreen button, unloading the original form will stop the TTS too. Also, the new fullscreen form will take long time to initilize the (new) audio data and RTB.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  17. #17
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    you wouldn't need to unload the original form, just hide it, but yeah, the initialization of the new form could take a while.

    Perhaps you could run the two versions of the form side-by-side, and then when you switch, the speech just picks off from where the other form left off.

  18. #18

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    iRead : Text-To-Speech Application

    Here is my complete project. I'll upload it in utility bank after adding some more features.
    Attached Files Attached Files
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  19. #19
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    your zip is missing the xvoice.dll

    i downloaded it but am getting 'ActiveX can't create object' on this line:

    Engine = DirectSS1.Find("Mfg=Microsoft;Gender=1")

  20. #20

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    Quote Originally Posted by bushmobile
    you wouldn't need to unload the original form, just hide it, but yeah, the initialization of the new form could take a while.

    Perhaps you could run the two versions of the form side-by-side, and then when you switch, the speech just picks off from where the other form left off.
    Sounds like a good idea. That way the TTS engine will not need to me initialized again.
    The only problems that may occur is, the new RTB will take long time to initialize.

    Re: XVoice.dll:

    This program uses Microsoft Speech API 4. You'll need to download SAPI4 engine.
    http://www.microsoft.com/speech/download/old/sdk40a.asp
    I guess it comes with WinXP or later. I think only installing the engine will work.(spchapi.EXE - 848 KB)

    Many free SAPI voices: http://www.bytecool.com/voices.htm
    (I like 'Mary' best)

    Note: SAPI4 voices will not work with SAPI5
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  21. #21
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    I downloaded the engine & voices and it's now working perfectly. It's a nice program

    I was a bit shocked when I saw the fullscreen animation, but then I realised you hadn't put the new stuff in

    One thing I've noticed is that is doesn't pause when it reaches a vbCrLf, e.g.:

    Visual Basic
    Visual C++
    Visual FoxPro
    Visual InterDev
    Visual J++
    is read as if it's all one sentence.

    Quote Originally Posted by iPrank
    The only problems that may occur is, the new RTB will take long time to initialize.
    What would take a long time to initialize?

    As the main form is reading, move the cursor on the fullscreen form. When fullscreen mode is pressed, show fullscreen, press stop on the main form, & press read from cursor on the fullscreen form. And then visa versa.

    p.s. Female Whisper sounds like it comes straight out of a horror film

  22. #22
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    You should add some checking when you change the pitch and the speed. There is a max for both. The slider passed both max values with the voice of sam (didn't try any other ones).


    Has someone helped you? Then you can Rate their helpful post.

  23. #23

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    Quote Originally Posted by bushmobile
    I was a bit shocked when I saw the fullscreen animation, but then I realised you hadn't put the new stuff in
    Sorry. My latest code is a mess after testing all those animation codes.

    One thing I've noticed is that is doesn't pause when it reaches a vbCrLf.
    TTS engine doesn't pause in CrLf. It pauses on punctuation marks. I'll add this feature if you like.
    What would take a long time to initialize?
    If the text in RTB is long, it will take very long time to update. As my app can save last reading paused position and can resume from that position when you restart the app. I expect my users will paste long texts.

    I'm planning to add HTML support. Then it may take even longer if the pageis image intensive.

    As the main form is reading, move the cursor on the fullscreen form. When fullscreen mode is pressed, show fullscreen, press stop on the main form, & press read from cursor on the fullscreen form. And then visa versa.
    That will cause the TTS engine in fullscreen form to initilize. Takes very long time on longet text.
    I'm planning to add the TTS engine in only main form.
    When user presses fullscreen, the TTS will be paused. (quick)
    Then copy rtf from main form to the fullscreen form. (will take time)
    Hide the main form, show the fullscreen form.
    Resume TTS and highlight RTB in fullscreen form.

    p.s. Female Whisper sounds like it comes straight out of a horror film
    I find it very $esy.

    Quote Originally Posted by manavo11
    You should add some checking when you change the pitch and the speed. There is a max for both. The slider passed both max values with the voice of sam (didn't try any other ones).
    Thanks. I had tested it only with Mary. I'll try to kill the bug.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  24. #24
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    That will cause the TTS engine in fullscreen form to initilize. Takes very long time on longet text.
    I'm planning to add the TTS engine in only main form.
    When user presses fullscreen, the TTS will be paused. (quick)
    Then copy rtf from main form to the fullscreen form. (will take time)
    Hide the main form, show the fullscreen form.
    Resume TTS and highlight RTB in fullscreen form.
    oh well, i didn't think it'd be a particularly practical idea when i came up with it anyway.

  25. #25

    Thread Starter
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is there any way to stop Window-Resize Animation for my Form only ?

    Actually it is your post that gave me the idea.

    Thank you very much.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width