Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Disabling F10 When Form Unloads


Hi,
I have this application when f10 is clicked it opens its own menus probably thru hotkey. Ive managed to position this app on top of my interface when a button is pushed. But when the button is released this application is then hidden and you could open other windows and stuff on the interface. But when f10 is clicked, it opens up that application menus. So I want to disable the f10 key when Ive hidden the application therefore it wont show when I look at other menus on my interface and if the user does not accidentally press f10. Ive found some threads on disabling ctrl-alt-del using registry. Should I be doing the same for function keys?
Or is there another way?

Thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Save Box When Form Unloads
I have a form with a rich text box so the user can type text into it and when the user closes the form i have a message box appear asking them if they want to save. I want to be able to have the 'Save As' dialog box appear when they click yes, so the text they have typed is saved.
But i cant work out how to do it, so if anyone can help it would be much appreciated

VB6(SP6) Crashes When My Form Unloads
I have an app using demo Crystal XI Developer and Microsoft Access/Jet 2000 where a crash occurs on unloading a form. It happens everytime the order of the FRAMES in a form is changed from the order which applied when VB did not crash. As to why this should be so and what happens to make changing the order of the frames critical, I have absolutely no idea. I have 5 "main" frames on the form which are switched visible/invisible using a TAB control on the form. Each "main" frame contains further frames and other objects. When VB started to crash on exit, I examined the formname.frm file using Notepad and noticed that the order of the BEGIN VB.FRAME framename statements for the "main" frames had changed compared to the previous version which did not crash. Using the form editor in the IDE, I restored the "main" frame order to that which did not crash and the crashing went away! This allows me to enhance the form but the ZOrder (I think it is) must stay the same otherwise VB crashes when the form unloads. The form needs a lot more development so proceeding on this basis - having to restore the sequence of frames - is a pain. Does anybody understand this and might you maybe tell me what I might do to make the real problem go away?

Can you tell me what the filename.frx file is for and can it be used to help diagnose the problem further?

This has happened before in other apps and I "solved" by restoring from backup and was not so constrained by the frame order. I "believe" that the problem of crashing on form unload may be connected with editing code on the fly while VB is running - I am almost but not quite certain that this statement is true.

I found Tek-Tips thread222-977856: Copy Multiline TextBox Array to a Container but I don't understand if there might be any connection. I do have some multi-line textboxes in the form but they have been running since the early days of the app and have not changed in the last 9 nine months.

Thanks for whatever help you can offer - this is a big app on which I have been busy for about a year.

Status Of Objects After Form Unloads
If I create an object from a form and set the Parent of that object to form, will the object be lost when I close or unload the form?

Pls Help !! To Wait Till Another Form Unloads ...
Hey there,

Hmm... i am relatively new to VB (3 months?) so this is one simple problem which has been kinda racking my brains ... would appreciate any help

ok . My program has this certain procedure which i need to repeat for a list of items .... then this procedure requires a new form to be opened ... which actually just prints the data out ...

but the problem now is that while the new form loads ... the program continues in its original form and processes the other items in the list ... which cannot happen !!! cos the new data processed is to be used in the new form

question is .. how do I code my program such that it waits for the newform to unload then continue on with the other items ?!?!

Please help .... its greatly appreciated !

"Windows In Taskbar" Unloads Hidden Word Form
My organisation is upgrading Office 97 to XP.

We have a word template which is loaded at start up and creates a ToolBar. If the users selecting an icon on this ToolBar, it runs a procedure from the template the loads a form (frmMenu.Show) which is a menu system for correspondence letters with the top letter highlighted. If a user selects a correspondence letter to open, the form is hidden (me.hide) and the correspondence letter is created. If the user selects the toolbar icon again, the hidden menu form is made visible with the last selected correspondence letter highlighted. Essentially the form should never be unloaded until you close Word.

A problem occurs due the WD2002 having a new Option "Windows in Taskbar" which if enabled displays each document in it's own Window in the taskbar. If a user selects two or three correspondence letters and then closes all of them (but does not close Word) then the form is unloaded. Therefore if the user selects the toolbar icon, the form will reload because it is not loaded

If I turn off the Option "Windows in Taskbar" the form is only unloaded when you close Word.

It seems is if the user's are closing the owner of the form.

Any help will be appreciated.

"Windows In Taskbar" Unloads Hidden Form
My organisation is upgrading Office 97 to XP.

We have a word template which is loaded at start up and creates a ToolBar. If the users selecting an icon on this ToolBar, it runs a procedure from the template the loads a form (frmMenu.Show) which is a menu system for correspondence letters with the top letter highlighted. If a user selects a correspondence letter to open, the form is hidden (me.hide) and the correspondence letter is created. If the user selects the toolbar icon again, the hidden menu form is made visible with the last selected correspondence letter highlighted. Essentially the form should never be unloaded until you close Word.

A problem occurs due the WD2002 having a new Option "Windows in Taskbar" which if enabled displays each document in it's own Window in the taskbar. If a user selects two or three correspondence letters and then closes all of them (but does not close Word) then the form is unloaded. Therefore if the user selects the toolbar icon, the form will reload because it is not loaded

If I turn off the Option "Windows in Taskbar" the form is only unloaded when you close Word.

It seems is if the user's are closing the owner of the form.

Any help will be appreciated.

Disabling The X Icon In A User Form To Prevent Closing A Form From There
Hi,

How do I disable the X icon on the right top of a form, so that the user cannot close the form in this way ?

Disabling All Form's Control Or The Form Upon Opening The Form.
Hi There

Here is my Objective (What I want to accomploish).
Upon opening a Form Called “Search”, the Curser gets focused on a ComboBox called “comboTrans”, And the user must select a value form the ComboBox before they are allowed to move to any other Control. (That is all)
Off Course since the form is an Unbound, They should be able to close the Form any time they wish, Even thou, they have not selected any value from the ComboBox “comboTrans” yet.

I tried many different events of The control and the form itself.
The closest that I came to reach the above objective was in Lostfocus Event of the control itself, But It causes problem when the user decides to close the Form before entering any values ‘for any reason”, the Control’s msgBox Keeps Popping Up.

Therefore I decided a different technique;
And that is Upon Opening the Form, Basically disable or Lock all the controls in the above Form or the Form itself, Except the ComboBox. Then setting the focus on the Active ComboBox, and Even if the User moves to other control, with the help of a MsgBox Forcing the user to move back and select a value from the Active ComboBox
And in the AfterUpdate event of the ComboBox make all other controls Enabled or active again.
A note the form has No record Source and the Control itself is unbound and has No Control Source.

Best Regards
Sanan




Edited by - sanan on 1/6/2005 7:25:56 AM

Disabling Buttons On MDI Form From A Child Form
I would like to disable the toolbar buttons on the MDI form from a child form

I write:

frmMDI.tbtoolbar.buttons(2).enabled = false

from the MDI child but I get an error

"Only one MDI form allowed"

Does anyone know how to do this?

Disabling Buttons On MDI Form From A Child Form
I would like to disable the toolbar buttons on the MDI form from a child form

I write:

frmMDI.tbtoolbar.buttons(2).enabled = false

from the MDI child but I get an error

"Only one MDI form allowed"

Does anyone know how to do this?

Restoring Old Resolution After DX Unloads
I've got some code that tries to restore resolution to windows from my DX application from fullscreen. I was wondering if it was normal when it comes out of the app that windows that you had open before hand (in this case, visual basic) will be the resolution the app is in. My windows res is 1280x1024, and I shift to 800x600. Is it normal for it to change the windows, or is it my code. Here is the code.

Public Sub ExitApp(hFrm as Form)
On Error GoTo errOut
Call dd.RestoreDisplayMode
Call dd.SetCooperativeLevel(hFrm.hWnd, DDSCL_NORMAL)
Set TileSet = Nothing
Set Primary = Nothing
Set BackBuffer = Nothing
errOut:
End
End Sub

Thanks,

Slyprid

Program Unloads, But The Icon Is Still On Sys Tray
Hey, I recently added the code to my program to minimize it to the system tray. But whenever I close the program, I have to roll the mouse over the icon to make it disapear. Is there anyway to force the sys tray to refresh? I know that running the mouse over it forces it to refresh so I was thinking possibly some way to send the mouse cursor over the tray. Not to sure if this could be done so I'm hoping someone will suggest an easier solution

Object Will Not Unload Until Application Unloads(Help!!)
Hello there!!!

I have an ocx(singlethreaded) on a form that isn't unloading when it's container is unloading.
I have found that if the ocx is apartmentthreaded it will fire the terminate event.

I cant set this ocx to apartmentthreaded because a object I use in this object is singlethreaded.

I know there is a way to unload objects via it's pointers.

Is there anyone who can help me with this api's

Msgbox Unloads App- Win Server 2003
I have an app that unloads when a message box is displayed. The message box appears for about 2 or 3 seconds, and then the app unloads. I am running the program on win server 2003.
The app runs fine on my desktop (win2000) and on a win server with xp2002.
I also installed a test program with nothing on the main form but one command button that displays a message box. Same results, msgbox appears and then the app unloads.
Any suggestions?
Thanks for any help you can supply.

Disabling All Buttons In A Form
I have the following code:


Code:
Public Function enableControls(flag As Boolean)
Dim ctl As Control
For Each ctl In Me.Controls
If Not ctl Is XXXXXXX Then
ctl.Enabled = flag
End If
Next

End Function
and i am trying to disable everything except say a Multipage or a button.

But what do i put in the XXXXX?

Thanks

Disabling Enter Key On Form
Good day

Anybody knows how to disable the Enter key on a form ?

I tried everthing I could (setting the KeyAscii to 0 on KeyPress, capturing the code on KeyDown)

Many thanks

Disabling Menu On A Form
I want to disable the menu items on a form.

something like


Code:
Dim mnu as Menu

'If my coding is true then

mnu.Enabled = False

p.s this [vb] doesnt work dont know why??

Disabling Title Bar Of The Form
i have created one form in VB with miximised property state. it should be miximised all the time.

now about the problem, when user double click on restore button or double click on the title bar of the form, the form get restore to its original position. i even try to put code in resize even of the form to again mizimise it. but its not look professional.

i have removed restore menu item from the control menu. but i didnt able to disable double click event on the title bar of the form.

one way i suppose, that one can diable double click event of the form by api programming or sub classing.

can any one help me in this regard??
thanx in advance.
firoz

Disabling Resizing In MDI Form
I want to make an MDI form so that it cannot be resized either by clicking/dragging on the window borders or by double-clicking the menu bar. I don't see any simple way to do this since MDI forms do not have the BorderStyle property. Any suggestions?

Mike

Disabling All But One Button On A Form
Basically you loop through all the buttons and disable them, and then at the end enable your cancel button.

VB Code:
Dim ctl As Control For Each ctl In Controls    If TypeOf ctl Is CommandButton then        ctl.Enabled = False    End ifNext ctl cancelButton.Enabled = True

Disabling Textbox In The Form
if we disable any text box in the form it display grey text in it. is it possible to display text dark black even it is enable = false???

how it is possible to do this???

thanx in advance

firoz

Disabling Max Button In An MDI Form
Hi,

I'm trying to disable the maxbutton in an MDIForm.

The following code removes the max menuitem and causes the maxbutton not to maximize the form when clicked. But it still looks as if it is enabled. When I do the same for the close (x) button it does look disabled.
How do I disable the maxbutton so that it also looks disabled.


Code:
Option Explicit

Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Public Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long

Public Const MF_BYPOSITION = &H400&
Public Const MF_REMOVE = &H1000&
Public Const MF_ENABLED = &H0&
Public Const MF_INSERT = &H0&



Public Sub DisableMaximize(frm As MDIForm, blnEnable As Boolean)
Dim hMenu As Long
Dim nCount As Long

If Not blnEnable Then
hMenu = GetSystemMenu(frm.hwnd, 0)
nCount = GetMenuItemCount(hMenu)

'Use cCount -1 to disable the closebutton
Call RemoveMenu(hMenu, nCount - 3, MF_REMOVE Or MF_BYPOSITION)

DrawMenuBar frm.hwnd
Else
hMenu = GetSystemMenu(frm.hwnd, True)
DrawMenuBar frm.hwnd
End If

End Sub

'In the midform
Private Sub MDIForm_Load()

Call DisableMaximize(Me, False)

End Sub

Disabling Form While Updating
ok, this is what i want to do..

i have created a form, where you can search edit and update the list..

the question is.

say there are 4 computer using this software from the same directory..
for example if the first comp is the only one which can update or edit..
and the rest is just to view the application.

k, if the first comp is updating the application..all the other computers cannot can not b using the application

k the first senario
if the one of the comp is running the program while updating...a message box should appear " the programm is being update and will be closing" and you presss ok and the programm closes

second senario
if one of the comp tries to open the application while its being updated...a message box should appear saying "the prograom is being updated. please try again later."

i have tried my best to explain what i want...if any question please dont hesitate to ask


Your help is appreciated..
Thank you
-Jay

Disabling Form Icon
Hi everyone! I have this simple question (at least it looks simple): how can I disable the form's icon, i.e. create an iconless form? Any ideas?

Program Unloads When Mouse Over Taskbar Icon In Vista
I have several applications. They all run fine in the Aero glass theme on Vista except one.

The odd one simply terminates (unloads) when the mouse is placed over its taskbar icon. This happens both running interpreted under VB5 or compiled.

Does anyone have any idea what in my code would cause this?

.

Enabling/disabling Many Items On A Form
I'm very new to VB, in this case within Access, and I'm a little mystified about how to complete one task. I'd like the majority of the fields and buttons on a form to go "read only" (disabled) when the selected record (part of an order) is "filled". Basically I would like to wire the fields to a method on the form that returns a bool saying whether or not that field should be enabled.

I can't see to see how to do this. The system currently allows me to set the enabled property only as Yes or No. What I want is to set it to my "shouldBeEnabled" function. Is there a way to do this?

There is a fairly similar function I would like to build to allow each field to display a colored border, red for things that need to be filled out and are currently empty, yellow for things they don't need to fill out but should, etc. For this task I would want to have a sub for each field that returns a color, but again it seems that that color can only be set to a fixed value.

Thanks!

Maury

Disabling The Print Form Button
Ok, here is the question. I have a calculate button, a clear button, a print button and a exit button. I have text boxes and other things. But the Print Form button will be available only after the calculation has been made--it will be disabled until the Calculation button is pressed the first time. When the clear button is pressed,the Print Form button will become disabled. The properties I have set now are: Print button enable property is False, default property of the calculate button is True, cancel property of the Clear button is True. My teacher gave us these hints to set the properties. Teacher also wrote: In the code for the calculate button, set the enable property to true for the print button, and in the code for the clear button, set the enable property to false for the print button. Can somebody please help me? I have tried to do this for 4 days now and I am stumped. Thank you very much. You can e-mail me at toykoon@aol.com if you like. Thanks......Scott

Disabling MDI Child Form Resizability
Hello,
I've searched through the forum looking for a solution to this, but I couldn't come up w/ anything that worked in my situation. I'm looking to create an MDI Child Form that loads Maximized, but has no MaxButton or MinButton.

When setting the form properties as such:
MaxButton = False
MinButton = False
WindowState = Maximized

It refuses to actually show the Child Form....I just want a maximized closable child form

Thanks,
WeezelDS

Enabling / Disabling A Timer Via Another Form
Sorry im in a bit of a hurry so i don't have time to find this out myself, but if i have a timer on a form (lets say form1) then how can i make a radio button on another form turn it on or off? (form2)

is there a way i can modify
timer1.enabled

or a property that allows it to be changed from any form?

Disabling All Objects On A Form [UNSOLVED]
Hi folks

My program states that when a user gets 0 money in their bank they cannot bet anymore. Now on the Final 16 form there are a lot of buttons and its tier-some to keep writing

If lblMoney.Caption = 0 Then cmdTRBet1.Enabled = False
If lblMoney.Caption = 0 Then cmdTRBet2.Enabled = False
If lblMoney.Caption = 0 Then cmdTRBet3.Enabled = False

etc etc

Is there a way I can just type one line to disable all my objects except the Quit button so they can close the form.

Disabling Maximize Button On A MDI Form
How can I disable the Maximize button on my MDI form? Can't find the property. I know the button is there for a reason but I don't wanna write code to resize all the child forms.

Sand Hawk

Disabling A Form And Still Process Code
anyone know how to do this?

I have another form that's always on top w/ a progress bar. I want it to disable the main form, yet still have the main form be able to process code.

Disabling The Close Button On One Form
hey, i wanna do as i said in the subject, any method to do so with an API or such?

Disabling User From Closing The Form
Hi,



Is there a way to prevent the user from closing my application abruptly?





Regards,

Subbu S.

Disabling The Restore Button On An Mdi Form
Could somebody please help me here, I'm working on an MDI Form and I want to either hide or disable the restore button.
I want the MDI Form to stay maximised all the time.

Disabling The Maximize Button On An MDI Form.
On a normal form it's possible to disable the Maximize Window button by settings the property MaxButton to FALSE. But on an MDI form this property doesn't exist. Is there a way to disable this button by using the SendMessage API or is there another way to handle it?

Thanks in advance,
Michael Nattfalk

Disabling MaximizeButton Prevents MDI-form From Being Drawn
Hi,

I have a MDI form with some children.
When i set MinButton and MaxButton to false the form won't display in the MDI.
When is et the Max to true it works. MinButton to false seems to be ok.

How can I get my children to be always maximized anyway?

thanks!

Disabling Command Buttons On A Form Before Opening It - Can It Be Done?
I am wanting to use my system with 2 sets of users...

When the form has been opened...
User 1, I want to allow the editing the records by using command buttons

User 2, I would like the user to be able to browse back and forwards, but NOT be able to Add/Amend/Delete records.


I already have the form setup with the controls described for User 1.

What I am wondering is, is it possible, using exactly the same form, I could open it for use with some of the buttons disabled?

eg. for User 2

cmdOpenForm_Click()

frmNewForm.cmdAdd.Enabled = False
frmNewForm.cmdUpdate.Enabled = False
frmNewForm.cmdEdit.Enabled = False

frmNewForm.Show


Would this work?

Or is there some other way I must go about it?

Disabling Maximise, Close, Minimise On MDI Form
Does anyone know how to either disable Maximise, Minimise and Close on MDI forms or to remove the buttons.

If you dont know how to, any ideas what I could do?

Cheers

Disabling Close Button On MDIchild Form
Is it possible to disable the close button (ie grey it out and remove it from the control menu) on an MDIchild form without disabling anything else.

Regards

Jon

Disabling Auto-resize When The Form Loads In MDI
my application uses MDI with the parent form and some of the child forms created through the Data Form wizard. I tried to fix the child form's width and height at design time to my desired width, height and position but at runtime, the form's width, height and position will always change back to it previous format. i think this is something to do with the default of the Parent form after it was created through the data form wizard but i don't know where exactly should the changes be made. And when i resize to smaller the Parent form at runtime, some of the forms are cut off (like, i cant see the buttons anymore) the next time a run the application. I don't like this.  
The only code available at the Parent form is getting and saving to the registry the current width, position and height located at the Form_Load and Form_Unload events respectively. I tried to chage the border of the child forms from sizeable to fix but i also don't get the min/max button of the form.

How do i fix this?

thanks,

Disabling A Control When A Modal Form Is In Focus?
I made an Active X control that loads in IE and calls separate forms for entering information. The problem is that when the form is in focus, you can still click on anything on the control on the IE window and mess things up like open up a form that's already open.

Does anyone have any ideas? Thanks!

Disabling Command Buttons On A Form Before Opening It - Can It Be Done?
I am wanting to use my system with 2 sets of users...

When the form has been opened...
User 1, I want to allow the editing the records by using command buttons

User 2, I would like the user to be able to browse back and forwards, but NOT be able to Add/Amend/Delete records.


I already have the form setup with the controls described for User 1.

What I am wondering is, is it possible, using exactly the same form, I could open it for use with some of the buttons disabled?

eg. for User 2

cmdOpenForm_Click()

frmNewForm.cmdAdd.Enabled = False
frmNewForm.cmdUpdate.Enabled = False
frmNewForm.cmdEdit.Enabled = False

frmNewForm.Show


Would this work?

Or is there some other way I must go about it?

Disabling Visual Basic Checkbox Of Form In Access
Hell I'm a beginner programmer and I need help with writing code to disable one checkbox when another one is selected.


Please Help Me


Thank You

Disabling Subform Without Disabling The Scrollers
Hi Eveyone,

I have a subform and i want to disable it so user can't change the values in it. However, I want the user to be able to scroll it since the subform is in Datasheet view and it has quite a lot of fields.

I tried locking it, but the user is still able to see the other options in the combo box and i don't want that to happen.

Is it possible to just disable the data entering or changing in a form directly (i want to be able to change the data through my main form)?

Disabling A TextBox Without Disabling Its Scrollbars.
Hello,
I have a very simple objective. Disallowing the user input into a TextBox. Its a multi-line one who's text I fill from code. If I set .Enabled to False, that also disables the scrollbars, which is something I don't want. What to do?

Thanks in advance for your help,
Nas.




Find out what you like doing best and get someone to pay you for doing it.

Disabling Red Button Red Button At The Top Right Corner Of A Form
Hello,
Is there a way of desactivating the red button that appears at the top right corner of a form?

Many thanks

Disabling "X" On The Form And Re-enabling It Later.
Is it possible to disable the "X" on the form whenever processing is being done by the form and then re-enable it when the processing is complete. *We process data against DB2, and it takes couple of seconds (sometimes 10-15) before the operation is complete. And we don't want the user to fool around and click on "X" when the data update is taking place"

TIA.

Disabling MS-DOS
How can I disable certain functions of DOS? eg. net send

Copyright © 2005-08 www.BigResource.com, All rights reserved