Results 1 to 13 of 13

Thread: I don't think I'm doing it right

  1. #1

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362

    Question I don't think I'm doing it right

    I using the code below to make my app go to full screen,
    However when I click on any buttons, toolbar, etc. It switches
    back to the standard window mode. Is there any way to solve
    this small problem? Maybe an alternative to the code or some
    sort of OCX or DLL?

    See My Last Post...
    Last edited by New to VB 6; Aug 13th, 2002 at 11:18 PM.
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  2. #2
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    Try using SetWindowPos to oversize your form and place the top left corner out of sight of the user.
    Please rate my post.

  3. #3

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362
    I would, but I'm not sure how. I got copied it from a web site that had a howto on how to make your app full screen and that's all they had.
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  4. #4
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    I'll see what I can come up with. Gimme a couple minutes.
    Please rate my post.

  5. #5
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    If you make a borderless form, to fill the entire screen, and set its .windowstate to normal, it will appear full-screen.

    You can then just use this one form (perhaps with a black background) to load all other forms, so you can't see the desktop.

    That's what I do anyway.

    -RJ
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  6. #6
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    With whatever coding I'm coming up with I'm assuming that you're using a form that HAS border and changing it to borderless. Mind you that my icon has come into effect.
    Please rate my post.

  7. #7

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362
    1st to rjlohan,

    I don't want a background form, to which I can load all my other forms. I'm going for a Full Screen / Not Full Screen option Like in some games and IE.

    2nd to Shawn N,

    Yup. I am using a form that has a border and changing it to borderless. as for "Mind you that my icon has come into effect." I'm not sure what that means
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  8. #8
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Ok, then this code will do it for you. Nifty little trick:

    VB Code:
    1. Me.Left = 0
    2. Me.Top = 0
    3. Me.Width = Screen.Width
    4. Me.Height = Screen.Height
    5. Me.WindowState = vbMaximised
    6. Me.WindowState = vbNormal

    You'll retain the form border. I don't know how to change the border style at runtime. You'll need API or some sort of subclassing for that. But this works, and you can change it at runtime back-and-forth by modifying that code for the reverse - you just need to maintain the previous size of the window in some variables for that.

    -RJ
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  9. #9
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    Originally posted by New to VB 6
    as for "Mind you that my icon has come into effect." I'm not sure what that means
    I think he meant his avatar, and tht avatar is a beer, so the beer has its effect
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  10. #10
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Originally posted by BuggyProgrammer


    I think he meant his avatar, and tht avatar is a beer, so the beer has its effect

    Well, that went right over my head...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  11. #11

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362
    Ok, ok, ok. I think I have figured out what I needed to say all
    along. I'm using the code below remove the window border
    because I can't do it with the .BorderStyle. the code I used
    removes the border, but when I click on a button, toolbar, etc.
    the window border come back. Is there a way to remove the
    border and keep it off until I Click the button to remove it?
    Maybe an alternative to the code or some sort of OCX or DLL?


    (My Code as from the form it's self)
    VB Code:
    1. '------------------------------
    2. ' Get/SetWindowLong Consts
    3. Private Const GWL_STYLE = (-16)
    4. Private Const WS_CAPTION = &HC00000
    5. Private Const WS_SYSMENU = &H80000
    6.  
    7. ' SetWindowPos consts
    8. Private Const SWP_NOMOVE = &H2
    9. Private Const SWP_NOOWNERZORDER = &H200
    10. Private Const SWP_NOSIZE = &H1
    11. Private Const SWP_FRAMECHANGED = &H20
    12.  
    13. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    14. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    15. Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    16.  
    17.  
    18. '-----------------------------------------------
    19.  
    20. Private Sub ActiveBar2_ToolClick(ByVal Tool As ActiveBar2LibraryCtl.Tool)
    21. Select Case Tool.Name
    22.  
    23.     Case "miFullScreen"
    24.         ActiveBar2.Bands("popView").Tools("miFullScreen").Visible = False
    25.         ActiveBar2.Bands("popView").Tools("micFullScreen").Visible = True
    26.         ActiveBar2.Bands("mnuMain").Visible = False
    27.         Me.WindowState = 2
    28.         Picture3.Visible = True
    29.         Dim wStyle As Long
    30.     wStyle = GetWindowLong(Me.hWnd, GWL_STYLE)
    31.     wStyle = wStyle And (Not WS_CAPTION) And (Not WS_SYSMENU)
    32.     SetWindowLong Me.hWnd, GWL_STYLE, wStyle
    33.    
    34.      'Force a refresh
    35.     SetWindowPos Me.hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_FRAMECHANGED
    36.    
    37.     If ActiveBar2.Bands("mnuMain").Visible = False Then
    38.         With ActiveBar2.Bands("tbWeb").Tools("Animation")
    39.             Set .Custom = Animation1
    40.             .Visible = True
    41.             ' Tool.Height/width should be in twips, its in pixels.
    42.             .Height = 300 '* Screen.TwipsPerPixelY
    43.             .Width = 550 '* Screen.TwipsPerPixelX
    44.     End With
    45.     ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = True
    46.     Else
    47.     With ActiveBar2.Bands("mnuMain").Tools("Animation")
    48.         Set .Custom = Animation1
    49.         .Visible = True
    50.         ' Tool.Height/width should be in twips, its in pixels.
    51.         .Height = 300 '* Screen.TwipsPerPixelY
    52.         .Width = 550 '* Screen.TwipsPerPixelX
    53.     End With
    54.     ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = False
    55.     End If
    56.    
    57.     ' I'm kind of clipping the image so that it fits.
    58.     ' A slightly smaller image would look better.
    59.    
    60.    
    61.     Animation1.Visible = True
    62.    
    63.     ActiveBar2.RecalcLayout
    64.    
    65.     Case "micFullScreen"
    66.         ActiveBar2.Bands("popView").Tools("miFullScreen").Visible = True
    67.         ActiveBar2.Bands("popView").Tools("micFullScreen").Visible = False
    68.         ActiveBar2.Bands("mnuMain").Visible = True
    69.         Me.WindowState = 0
    70.         Picture3.Visible = False
    71.    
    72.     wStyle = GetWindowLong(Me.hWnd, GWL_STYLE)
    73.     wStyle = wStyle Or WS_CAPTION Or WS_SYSMENU
    74.     SetWindowLong Me.hWnd, GWL_STYLE, wStyle
    75.    
    76.     ' Force a refresh
    77.     SetWindowPos Me.hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_FRAMECHANGED
    78. If ActiveBar2.Bands("mnuMain").Visible = False Then
    79.         With ActiveBar2.Bands("tbWeb").Tools("Animation")
    80.             Set .Custom = Animation1
    81.             .Visible = True
    82.             ' Tool.Height/width should be in twips, its in pixels.
    83.             .Height = 300 '* Screen.TwipsPerPixelY
    84.             .Width = 550 '* Screen.TwipsPerPixelX
    85.     End With
    86.     ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = True
    87.     Else
    88.     With ActiveBar2.Bands("mnuMain").Tools("Animation")
    89.         Set .Custom = Animation1
    90.         .Visible = True
    91.         ' Tool.Height/width should be in twips, its in pixels.
    92.         .Height = 300 '* Screen.TwipsPerPixelY
    93.         .Width = 550 '* Screen.TwipsPerPixelX
    94.     End With
    95.     ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = False
    96.     End If
    97.    
    98.     ' I'm kind of clipping the image so that it fits.
    99.     ' A slightly smaller image would look better.
    100.    
    101.    
    102.     Animation1.Visible = True
    103.    
    104.     ActiveBar2.RecalcLayout
    105.  
    106. End Select
    107. End Sub

    I'm using AcitveBar 2.0 from DataDynamics
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  12. #12

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362
    bump
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  13. #13
    Frenzied Member macai's Avatar
    Join Date
    Jul 2001
    Location
    Napanoch NY
    Posts
    1,228
    VB Code:
    1. Me.Left = -1
    2. Me.Top = -1
    3. Me.Width = Screen.Width + 1
    4. Me.Height = Screen.Height + 1
    This isn't truly fullscreen, but the user shouldnt know the
    difference.
    Luke

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