|
-
Aug 13th, 2002, 08:40 PM
#1
Thread Starter
Hyperactive Member
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]
-
Aug 13th, 2002, 08:49 PM
#2
Frenzied Member
Try using SetWindowPos to oversize your form and place the top left corner out of sight of the user.
-
Aug 13th, 2002, 09:07 PM
#3
Thread Starter
Hyperactive Member
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]
-
Aug 13th, 2002, 09:14 PM
#4
Frenzied Member
I'll see what I can come up with. Gimme a couple minutes.
-
Aug 13th, 2002, 09:42 PM
#5
PowerPoster
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]
-----------------------------------------
-
Aug 13th, 2002, 09:45 PM
#6
Frenzied Member
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.
-
Aug 13th, 2002, 10:09 PM
#7
Thread Starter
Hyperactive Member
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]
-
Aug 13th, 2002, 10:21 PM
#8
PowerPoster
Ok, then this code will do it for you. Nifty little trick:
VB Code:
Me.Left = 0
Me.Top = 0
Me.Width = Screen.Width
Me.Height = Screen.Height
Me.WindowState = vbMaximised
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]
-----------------------------------------
-
Aug 13th, 2002, 10:26 PM
#9
The picture isn't missing
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  .
-
Aug 13th, 2002, 10:38 PM
#10
PowerPoster
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]
-----------------------------------------
-
Aug 13th, 2002, 10:59 PM
#11
Thread Starter
Hyperactive Member
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:
'------------------------------
' Get/SetWindowLong Consts
Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_SYSMENU = &H80000
' SetWindowPos consts
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOOWNERZORDER = &H200
Private Const SWP_NOSIZE = &H1
Private Const SWP_FRAMECHANGED = &H20
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
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
'-----------------------------------------------
Private Sub ActiveBar2_ToolClick(ByVal Tool As ActiveBar2LibraryCtl.Tool)
Select Case Tool.Name
Case "miFullScreen"
ActiveBar2.Bands("popView").Tools("miFullScreen").Visible = False
ActiveBar2.Bands("popView").Tools("micFullScreen").Visible = True
ActiveBar2.Bands("mnuMain").Visible = False
Me.WindowState = 2
Picture3.Visible = True
Dim wStyle As Long
wStyle = GetWindowLong(Me.hWnd, GWL_STYLE)
wStyle = wStyle And (Not WS_CAPTION) And (Not WS_SYSMENU)
SetWindowLong Me.hWnd, GWL_STYLE, wStyle
'Force a refresh
SetWindowPos Me.hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_FRAMECHANGED
If ActiveBar2.Bands("mnuMain").Visible = False Then
With ActiveBar2.Bands("tbWeb").Tools("Animation")
Set .Custom = Animation1
.Visible = True
' Tool.Height/width should be in twips, its in pixels.
.Height = 300 '* Screen.TwipsPerPixelY
.Width = 550 '* Screen.TwipsPerPixelX
End With
ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = True
Else
With ActiveBar2.Bands("mnuMain").Tools("Animation")
Set .Custom = Animation1
.Visible = True
' Tool.Height/width should be in twips, its in pixels.
.Height = 300 '* Screen.TwipsPerPixelY
.Width = 550 '* Screen.TwipsPerPixelX
End With
ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = False
End If
' I'm kind of clipping the image so that it fits.
' A slightly smaller image would look better.
Animation1.Visible = True
ActiveBar2.RecalcLayout
Case "micFullScreen"
ActiveBar2.Bands("popView").Tools("miFullScreen").Visible = True
ActiveBar2.Bands("popView").Tools("micFullScreen").Visible = False
ActiveBar2.Bands("mnuMain").Visible = True
Me.WindowState = 0
Picture3.Visible = False
wStyle = GetWindowLong(Me.hWnd, GWL_STYLE)
wStyle = wStyle Or WS_CAPTION Or WS_SYSMENU
SetWindowLong Me.hWnd, GWL_STYLE, wStyle
' Force a refresh
SetWindowPos Me.hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_FRAMECHANGED
If ActiveBar2.Bands("mnuMain").Visible = False Then
With ActiveBar2.Bands("tbWeb").Tools("Animation")
Set .Custom = Animation1
.Visible = True
' Tool.Height/width should be in twips, its in pixels.
.Height = 300 '* Screen.TwipsPerPixelY
.Width = 550 '* Screen.TwipsPerPixelX
End With
ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = True
Else
With ActiveBar2.Bands("mnuMain").Tools("Animation")
Set .Custom = Animation1
.Visible = True
' Tool.Height/width should be in twips, its in pixels.
.Height = 300 '* Screen.TwipsPerPixelY
.Width = 550 '* Screen.TwipsPerPixelX
End With
ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = False
End If
' I'm kind of clipping the image so that it fits.
' A slightly smaller image would look better.
Animation1.Visible = True
ActiveBar2.RecalcLayout
End Select
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]
-
Aug 14th, 2002, 07:28 PM
#12
Thread Starter
Hyperactive Member
[VBCODE]
Option Explicit
Dim XXX As Porn
Dim Wife As Nag
Private Sub *****_Resize()
On Error Resume Next
Get Viagra
End Sub
[/VBCODE]
-
Oct 6th, 2002, 06:14 PM
#13
Frenzied Member
VB Code:
Me.Left = -1
Me.Top = -1
Me.Width = Screen.Width + 1
Me.Height = Screen.Height + 1
This isn't truly fullscreen, but the user shouldnt know the
difference.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|