Stop Maximized Form From Moving
I am using a picturebox as a container to act as a mdiparent because only 1 midparent is allowed when I need 2. When I maximize a "child" form, the title bar is still visible which enable the user to move the max form. I get an error when I set moveable=false during runtime. Is there any way to stop the maxed form from moving? Thanks.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Trying To Stop A Form Moving
hi, i am making a program that has docking forms onto the main mdi form. I am trying to make it so that the forms can be docked and undocked. I have so far made a timer that keeps a form in its position all the time but when the user tries to drag the form it flashes and such and then returns to the position wheras i don't want it to move at all, is there any way i can subclass it to stop it moving?
Stop Txt Moving
can any1 tell me how u stop txt that is in side a pic box moving ever thing u click in the box
Pic Box, Object To Stop Moving
what im trying to do is make it so that i have one bit picture box and a pong design interface inside it(this is a final assignment im making a variation of pong) anywho what im trying to do(and tryed everything i've thought of) is to get it so that when you drag the padel down it cannot pass the line at the top or the bottom, and both these lines are drawn, not made at runtime. thanks for help
also after you hit the line you cannot go down or up further then the line, and you can continue moving inside the two lines
How Do I Make A Shape Stop Moving?
I have a shape(Shape1) that you can move with the arrow keys....how do i make the Shape1 cease to move when a certain event happens, even though the arrow keys are still pressed?
thanks for any help!
ListView - Stop Icons Moving
Hi,
I'm using a listview control in the Icon mode, to display a control panel for my application. The only problem is that when a user clicks an icon, when you move the mouse it moves the icon as well.
Is there any way to stop the user moving the icon?
How Do I Stop Flickering In Moving Graphics?
I haven't dealt with graphics in vb before, but I know of a common graphics method to reduce/eliminate flicker in animations called double-buffering.
The flicker is caused from clearing the old frame before drawing the new one. To counter this problem you actually would have 2 picture boxes (or whatever you're using) the first one is the visible one that will display the animation. On the second buffer, you do the calculations for the next frame and place all the objects there, then once the frame is ready for display you change the image on the visible buffer to that of the second buffer.
Since I haven't done this in vb before I'm not to helpful in the code department, but hopefully you'll find this method usefull.
Trying To Stop Moving Past Last Record
I am writing a database with a number of tables with forms atttached to each table. I have placed navigation buttons on each form to move to first, last, next, previous. I have set up the code associated with the buttons as "public sub" so it is available for each form to use.
This was working OK except that when I used the NEXT button at the last record it would open a new blank record & keep opening a new blnak record on each click.
To over overcome this I put in an If statement to check if it had moved to a new record. To do this I used the following:
If Me!NewRecord Then ..... etc
Now I get an error "Invalid use of Me key word" I suspect it is because I am using ME in a public sub
How do I overcome the problem of moving passed the last record and still have the coding available to all forms?
The Code is below.
Thnaks for any help.
Public Sub Next_Record_Click()
On Error GoTo Err_Next_Record_Click
DoCmd.GoToRecord , , acNext
If Me!NewRecord Then
' If new record move back to previous
DoCmd.GoToRecord , , acNext
' Send message
MsgBox "This is the last record", , "No More Records"
End If
Exit_Next_Record_Click:
Exit Sub
Err_Next_Record_Click:
MsgBox Err.Description
Resume Exit_Next_Record_Click
End Sub
Maximized Form Resizes When New Form Is Loaded.
Hi all,
Another question here.
I have a MDI parent form with a child form loaded in maximized windows state. When I load a new child form (size is not maximized/not sizeable.), the previously loaded child form is resized to normal state.
I do not want this to happen. I want to keep all forms at their own size even new fixed-size forms are loaded later.
Please help.
Jeremy
Maximized Form
Hi,
I want to Maximized the main form in the program startup.
How can I do it?
Thanks, Tzachi
Form Maximized
Hi, i don't understand this, i have been trying to figured out what is happening but i can't. I need your expertise guys.
I'm developing a VB application which has:
- MDI form "frmPrincipal"
- Form "frmSearch"
- Dialog "dlgDetail"
Both frmSearch and dlgDetail are MDIChilds. I show the frmSearch (maximized, cause i wanted to be all the time in that state) first which has records from a database in a datagrid. When i double click one of the records, the dlgDetail should appear over everything with the detail information of the selected record. All of this has been done, but my problem is that when the dlgDetail form is shown, the frmSearch form change its size automatically. So how can I make this form to be maximized all the time??
Thanks,
Winston
Form Always Maximized
I'm using 4 child forms inside a Parent form. In one form I'm using 5 frames. When I go from one form to another form (with frames) and I want only one frame to be visible, I'm not able to see it in the full window. I'm doing it manually every time. Is there any way to keep all teh frames and forms in maximized position?
In the properties of all forms, I have made the WindowState as 2-Maximized only.
Ths is the code i use d to switch between forms
Form2.Hide
Form1.Visible = True
Form1.Frame1.Visible = True
Form1.Frame2.Visible = False
Form1.Frame3.Visible = False
Form1.Frame5.Visible = False
Stop User Moving The Chart Around In MsChart
VB6 SP6
I am using MsChart. I need to allow selections but when this is set to True users can click on the chart and move the plot area around the unplotted area.
Anybody know a way to avoid this
Thanks
Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!
thanks!
Stop A Moving Image Drawing Over Other Lines...
I have the following code which moves a little image control across the form, but what happens when it moves across slowly is it sort of half draws over lines that I have on the form....how can i get it so that it doesnt draw over the other lines and leaves them intact....so that it doesnt leave this kind of trail.....
VB Code:
Private Sub Timer1_Timer()If Image2.Left < 9240 Then Image2.Left = Image2.Left + 1'only move the picture one space over if it isnt alreadt at the desired locationEnd IfEnd Sub
How To Stop Cursor Keys Moving Focus ?
I am writing a program where an object can be moved round the screen. I first did this using command buttons and then wanted to add the option of using the keyboard cursor keys.
KeyAscii and/or KeyCode worked for most keys but not the cursor keys which didn't seem to generate any events. I got something working using an API call (GetAsyncKeyState).
The bit which still bugs me is that when the user presses the cursor keys, as well as moving the on-screen object, it also moves focus round the various command buttons.
Can anyone suggest how to stop this happening ?
Design Maximized Form
Hi,
I have finished with the designing of a form that has a number of controls on it. The WindowState for this form is Normal. Now the user wants it to be maximised. How do I design the maximized for to place the controls in the appropriate positions?
Thanks
Load Form Maximized
How do i tell a form to load Maximized as it would if you double clicked it or clicked the box?
i can do this
Code:
me.height = screen.height
me.width = screen.width
but that does not work out, cuts under startbar at bottom..
Thanks
Design Maximized Form
Hi,
I have finished with the designing of a form that has a number of controls on it. The WindowState for this form is Normal. Now the user wants it to be maximised. How do I design the maximized for to place the controls in the appropriate positions?
Thanks
Form Not Opening Maximized
I have a multi-form application, and use a DAO connection to an Access database. One subroutine is run when users click a command button on form Page 7. An Excel worksheet opens and data from form Page 6 is sent to the worksheet. My problem is that when users save and close the form, the application now shows Page 6 loaded rather than Page7, assumably because the last code run reference Page 6.
To correct this, I added two lines of code to the end of the subroutine:
VB Code:
Unload frmPage6 frmPage7.Show
It does the trick except that frmPage7 is not maximized. This is irritating. The windowstate is set to maximize in properties. Is there a way I can set this at run-time?
Maximized Form's Properties
Hi.
I want to center an MDI Child Form in a Maximized MDI Parent Form. How do I get the Height and Width of the Maximized Parent so that I can center the child?
Thx.
Maximized Form Under Task Bar
I have an MDI and MDI children both set to windowstate maximise.
Unfortunately the bottom of the form is under the Task bar. How can I avoid this happening?
Additionally the child formas contain a MSFlexGrid, which I am setting to the same size as the form, but part of the right side of the form is obscured by the scroll bar. Is there a generic method for setting the internal control (FlexGrid) to fit neatly and practically into the form?
Newbie hoping some-one can help!
Design Maximized Form
Hi,
I have finished with the designing of a form that has a number of controls on it. The WindowState for this form is Normal. Now the user wants it to be maximised. How do I design the maximized for to place the controls in the appropriate positions?
Thanks
Can This Be Done? Borderless, Maximized Form In VBA? Please Help! Anyone?
ok, this may sound ridiculous, but I am really stuck here!
In VB it is quite simple to make a borderless, captionless, maximized full screen form. How on earth is this done using VBA from excel? I have been unable to do this and it is driving me fuznuts! Anyone?
thanks,
-Randy
Edited by - RanDaMan on 1/9/2003 8:32:41 AM
How Can I Check If A Form Is Maximized?
Hello, all! I'm pushing the performance possibilities of Excel to the limits making a program that should really be a stand-alone app with a SQL database. But nonetheless, it is in Excel 2007 for Windows XP.
I have 4 forms that are created to give the user an interface to work with, rather than the dozen or so worksheets. I'm getting everything to work OK so far. I just got into auto-sizing a form to the screen, based on the user's available workspace. (see below)
Code:Option Explicit
Private Declare Function SystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, _
ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Public Const SM_CXSCREEN = 0
Public Const SM_CYSCREEN = 1
Const SPI_GETWORKAREA = 48
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
Width As Long
Height As Long
End Type
Public Work As RECT
'When the Excel file is opened, this runs automatically
Public Sub DisplaySetup()
Call GetWorkArea
With frmUserForm1
'For some reason, using 100% of Work parameters was exactly
'25% larger than the actual screen size. Anyone know why?
.Left = Work.Left * 0.75
.Top = Work.Top * 0.75
'These are cut in half so 4 forms can fit on the screen together
.Width = (Work.Width * 0.75) / 2
.Height = (Work.Height * 0.75) / 2
.Show (0)
End With
End Sub
Public Sub GetWorkArea()
Call SystemParametersInfo(SPI_GETWORKAREA, 0, Work, 0)
With Work
.Width = .Right - .Left
.Height = .Bottom - .Top
End With
End Sub
Each form has a Max button but no Min or Close button. Now my problem is that I have no way of knowing if a form is maximized in code. You can check the height and width against the screen size, but the user could have sized it that large themselves. The reason this is a problem is because I do things in code that affect the form's size. If the Maximize button is used, the form cannot be resized. But if the user sizes the form themselves, it can. Does that make sense?
So my question to you is this: how can I know in code whether a form is Maximized?
Thanks!
- bungee41
Edited by - bungee41 on 6/24/2008 11:47:23 AM
Starting A MDI Form Maximized And Centered
I'm trying to start an MDI form maximized and then I want all the objects on the child forms to be centered on the screen. Could someone help me out and let me know how to this or point me to a resource that points out how to do this? Thanks
Maximized Form With Visible Task Bar
Hello,
I have set the state of my form to maximized at design time, but this takes up the entire screen overlapping the taskbar. I would like to set the form to maximized so that it takes the whole screen but leaves the task bar visible but stops the user being able to size the form if this is possible,
Thanks
Maximized Form Covers Taskbar
I used the code from http://www.vbforums.com/showpost.php...12&postcount=5 to remove the titlebar from my form and keep is resizable but whenever I maximize the window, it fills up the entire screen, covering up the taskbar. How do I stop it from doing that?
Form Width/Height Different Than When Maximized
I have a form that I set to be Maximized when it is loaded. However, when I look at the height and width properties...they are the same size as what the form is in the development/design mode. Shouldn't it take on the new values when the form is maximized? And if not, how can I find what the values are when the form is maximized?
Thanks
Resize Maximized Child Form
Hello,
I have created a child form inside another form using the SetParent API. When the child form is maximized, it doesn't resize when the parent form is resized.
does anyone know a solution?
Thanks
Maximized Form [RESLOVED FINALLY]
Private Sub Command6_Click()
Dim form As form
Dim RegObj, RegKey As String
Dim read As String
Set RegObj = CreateObject("WScript.Shell")
RegKey = RegObj.RegRead("HKEY_CURRENT_USERSoftwareVP-EYEApp4_path")
MsgBox "The Registry key value is " & RegKey & "!"
Set RegObj = Nothing
ChDir "C:Program FilesDISVP-EyeMagic"
Shell "phmagic.exe", vbNormalFocus
Me.WindowState = vbMinimized
Form1.Hide
If Then
Form1.Show
End If
End Sub
----------------------------------------------------------------------------------
I have hide the form into systray icon(minimized), but how to call it out after i finish execute phmagic.exe??
Making A Form Start Maximized
this is something simple i dont know. I want to make form 2 appear. like this
Form2.show
but i want it to be maximized focus, what is the code?
Maximized Child Form Not Visable
Hello All;
I am new to MDi forms but not completely new to VB. The problem I have is that I have a child form (used for a logo) that I want displayed at startup. If the child form Windowstate is set as minimized or normal it can be seen. If it is set to Maximized it is not visable at all. However as a test I added a menu to the child form and the menu of the child form is visible on the parent form but the child form itself is not visible.
If the child form is started in a normal windowstate and then maximized with a menu click etc it works fine.
I have spent a lot of time on this and have no explanation. Can anyone help?
Thanks,
Fred
Maximized Form And Screen Resolution
Hi,
I have designed a form with about 53 controls on it. I want the form to be in the Maximized state when it is loaded without covering the Taskbar. Also, the form and the controls should be adjusted according to the different screen resolutions. How can this be done? Please help.
Thanks.
Maximized Form And Screen Resolution
Hi,
I have designed a form with about 53 controls on it. I want the form to be in the Maximized state when it is loaded without covering the Taskbar. Also, the form and the controls should be adjusted according to the different screen resolutions. How can this be done? Please help.
Thanks.
Keeping A Child Form Maximized
Hello Gurus,
I have a main MDI form and two child forms.One of these child forms has the BorderStyle set to FixedDialog.Supposing this is Form2 and the other child form is Form1.Now when I click on a button on Form1,Form2 is displayed.I want Form2 to open up as a Dialog whereas Form1 should remain in its place...But when I do this, Form1 doesn't remain in its maximized state...It gets restored.How can I keep the earlier form in its maximized state?Any help would be highly appreciated.
Thanks,
-Ekta.
Making A Label Stop Moving When It Hits A Certain Point[solved]
I have a long Label, it shows text, I want it to scroll slowly, but how do I make it stop at a certain point, If I do
VB Code:
Private Sub tmrAbout2_Timer() DoEvents LblAbout.Top = LblAbout.Top - 10 DoEventsIf LblAbout.Top <= 0 Then tmrAbout2.Enabled = FalseEnd Sub
Then it stops when the top of the label hits the top of the form/frame, I want it to scroll through the top of the frame, Its fine if I dont put an If then but it keeps going forever.
Making A Form Maximized In Access 2002
I was wondering what properties/code/anything is needed to make a form a maximized form for Access 2002 and VB. I am doing a multiple document interface kind of. I have a form that will be a maximized form covers the whole background of the users environment and then put subforms on the main form that change. WHenever i try to do it, it will never line up and there isnt a maximized property in access. I can maximize the whole app, but is there an easier, more flexible way? I want my form to pretty much look like this:
http://www.athletesdatabase.com/wm.htm
so i have a main form as the container for all the subforms, but I am having problems making it encompass the entire screen. Help please!
JEff
Is It Possible To Detect When A Form Is Maximized From Clicking It In Taskbar?
Here's the problem:
When I have my MP3 player and playlist (separate forms) open and click the MP3 player's minimize button, both forms minimize. Of course, this is what I want to happen. When I click the MP3 player in the taskbar, only my MP3 player comes back up, which is not what I want to happen. My playlist has the showintaskbar property set to false because I don't want that form by itself minimized....only opened and closed. This is similar to what winamp does with its browser window. If you minimize the mp3 player, both are minimized, but only the mp3 player shows up in the taskbar....and both are brought back by selecting the mp3 player.
My question is, is there a way that I can detect when the user clicks the program in the taskbar?
Here's the code i'm using to minimize:
Code:
Private Sub imgMinimize_Click()
frmMP3.WindowState = 1
If frmWritePlaylist.Visible Then
' If the playlist is open, then minimize it as well.
frmWritePlaylist.WindowState = 1
End If
End Sub
Any help is greatly appreciated.
MDIform Next Form When Maximized Is Resizing Stuff...
Greetings!
Here's a problem I really need help with.
- My app is an MDIform.
- The MDIform have a "WindowList" menu.
- In my MDIchilds form I have 3 pictureBox and 2 that are top aligned or bottom aligned.
- When a child form gets resized, the pictureBoxes gets resized in a manner that there is no space between them.
Ok, when I switch between my Child form, I want the pictureBoxes to keep the same size and positions.
But, there's a Windows process that is really making my life a living hell:
When the childs are maximized, then I hit Ctrl-Tab to go to the next child, the form that was active gets "restored" before the next form gets Maximized (so the form that was active gets resized).
So when I go back to the previous form, hte pictureBoxes don't have the correct height and positions.
Basically, what I am trying to do is catch the message that says "Hey! I am going to the next form!". I tried with subclassing the MDIChild forms with the message WM_SYSCOMMAND and then checking for SC_NEXTWINDOW. Works (almost) fine. But if the user go in the menu that is a WindowList, the WM_SYSCOMMAND message does NOT fires up.
Could please someone help me with this one?
Thank you!
P.S.: I really am ****-poor bad at explaining things so, it what I am trying to do does not seems clear, just tell me and I'll try to clarify.
Maximized Form Occupies Taskbar Space
I made a custom form(no titlebar with borderstyle set to none) and I made a maximize button. Unfortunately, when I maximize the form, it lowers the taskbar and the form is completly in full screen mode. What I would like, is the form to be maximized, but like the other windows applications, where the form is maximized, but isn't in full screen mode.
How To Get Client Area Size Of A Maximized Form?
Can any clever person out there tell me a way to get the exact size of the client area of a Maximized form in VB6.0? I have tried width/height but that just gives it for the Normal size as does ScaleHeight/ScaleWidth. If I use the Screen.Height & Width, then it includes the Windows Taskbar and the Status Bar on my form (I can subtract the StatusBar height but don't know how to get the TaskBar height). I want to find only the useable client area of the Maximized form so that I can dynamically position controls at any resolution. I am looking for a relatively simple solution if possible or at least something involving VB6.0 or WinAPI code that a neophyte such as myself can comprehend!
Thanks.
clouthier
Maximized Child Form Messes Up Menus
I've got an MDI app that needs some menu titles hidden under particular scenarios. When I try to hide the Edit menu, the File menu goes away (always the menu title before the one I request). This only happens when the MDI child is Maximized. I understand that the MDI Child window throws in it's own system menu and that definitely appears to be the thing that throws it off.
Does anybody know how to fix this? I can't rearrange the code to make the visible/invisible happen before maximize without breaking other things (a workspace persistence issue). If nobody knows of anything easier, I'll force the child window state to normal, hide the menus, and reset the state back again.
Thanks
My Form Looks All Screwed Up When It Doesn't Start Off In A Maximized State
When the form starts off in a maximized state (ie switching it manually at design time) it's fine, but when I maximize the form at runtime (by clicking a button) the height of the listbox and dirlist seem to double in size. Here's my code:
VB Code:
Private Sub Form_Resize() If Me.WindowState = vbMaximized Then Picture2.Left = Me.Width - Picture2.Width - 90 Picture3.Left = Picture2.Left - Picture3.Width Picture1.Left = Picture3.Left - Picture1.Width Label1.Width = Picture1.Left Shape1.Width = Me.Width lvwFilesInDir.Height = lvwFilesInDir.Height + 3600 lvwFilesInDir.Width = Me.Width - 3050 Dir1.Width = lvwFilesInDir.Left - 300 Dir1.Height = lvwFilesInDir.Height Label2.Top = Dir1.Height + 1100 Drive1.Top = Label2.Top Drive1.Width = Me.Width - 1450 Line1.Y2 = 9500 Line2.x2 = Me.Width - 180 Line3.x1 = Line2.x2 Line3.x2 = Line2.x2 Line3.Y2 = Line1.Y2 Line4.Y1 = 9500 Line4.Y2 = Line4.Y1 Line4.x2 = Line2.x2 ElseIf Me.WindowState = vbNormal Then Picture2.Left = frmMain.Width - Picture2.Width - 90 Picture3.Left = Picture2.Left - Picture3.Width Picture1.Left = Picture3.Left - Picture1.Width Label1.Width = Picture1.Left Shape1.Width = Me.Width lvwFilesInDir.Height = 5055 lvwFilesInDir.Width = 5655 Dir1.Width = 2415 Dir1.Height = 5040 Label2.Top = 6120 Drive1.Top = Label2.Top Drive1.Width = 7215 Line1.Y2 = 5880 Line2.x2 = 8520 Line3.x1 = Line2.x2 Line3.x2 = Line2.x2 Line3.Y2 = Line1.Y2 Line4.Y1 = Line1.Y2 Line4.Y2 = Line1.Y2 Line4.x2 = Line1.Y2 + 2650 Else Exit Sub End IfEnd Sub
Also, when my form starts off in a maximized position, the middle button will not change. (This is a custom form.) Here's my code for that also:
VB Code:
Private Sub Form_Load() Me.Left = Screen.Width / 5 Me.Top = Screen.Height / 5 Dir1.Path = App.Path If Me.WindowState = vbMaximized Then Picture3.Picture = LoadPicture(App.Path & "ImagesRestore.gif") End If Debug.Print Me.WindowState SetWindowLong Me.hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, GWL_STYLE) + WS_DLGFRAMEEnd Sub
I did a Debug.Print on that, and for some reason, it thinks the window is in a Normal state.
|