I'm creating a program, with one main form, and one option-form. But I want that when you are on the option-form, you can't do anything on the main form. Does anyone know how I can do that??
Grtz and Thx
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Form - Deactivate
I have form1 and form2. From form1 i load form2. In this case form1 's deactivate event gets fired. I don't want this to happen.
This doesn't happen when we open a VB MessageBox.
Deactivate A Form
I have created a VBA form. In that I have a button. When that button is pressed, the selected text will become bold.
What I want is, once the button is pressed the form should get deactivated after making the text bold. This is because I want to continue to edit my document after pressing this button. Now what I do is, I use the mouse to click on the document so that the form get deactivated and the current selection becomes active. Can this be done programatically? Is there a way to make the form loose its focus? or Is there a way to make the selection active?
Please help me.
VB - Form Deactivate
I have a form. I open another form from this form.
In this case Deactivate event of the first form is getting fired.
But i don't want that to happen.
When VB message box is opened this doesn't happen. How can i restrict this.
How To Deactivate The Main Form
There are two forms, Form1 and Form2. On Form1 is a command button named Command1.
Here's the code:
Private Sub Command1_Click()
This would make Form2 appear, but I don't want the user to be able to access the main form, Form1, while Form2 is on the screen. I don't want to use the Hide method to hide Form1, I want Form1 to still be visible, but unclickable. How do I do this?
Form Deactivate/lost Focus
i have 2 forms and on form1 ive the following code
Private Sub Command2_Click()
Private Sub Form_LostFocus()
my purpose is to unload form1 when form1 loses focus. but in this case form 2 loads and gets focus, but form1 is not unloaded. strangely, if i take of the msgbox, it works as inteded.
Public Event In Form Deactivate Event
How do you make a dynamic array created in the Form Deactivate Event able to be “public” or used in other events such as Form resize event.
Is there another way other than storing the array in a public sub?
Deactivate Right Click
Hi I need to deactivate de Right click menu, Copy paste etc.
Someone knows how.
I know that with the mousedown event I can know wich button I click but I can´t deactivate the menu.
Thank´s a lot
I have a huge Problem and unfotunately I think there wouldn´t be an answer for it. But if there is one, so I´m sure, you´ll tell me... :-)
I want to deactivate the AutoRecover Function for my Excel-VBA Application. OK, that seems easy! But no, not for WindowsNT!!
For WindowsXP I can use this Statement: "Application.AutoRecover.Enabled = False"
For WindowsNT I can only try to hack the Registry... --and God knows I don´t wanna do that :-)
Thanks for your help!!
Deactivate An Application
I would like to know if there is any thing like appactivate to deactivate an application any insight would be of help
I`m searching for a function with which I can (de)activate my networkadapter, but I haven`t found anything til now.
I want to make it from one of my programs.
Is there a special API which can to that (NdisOpenAdapter - NdisCloseAdapter or something else?).
Or are there any other methods to do that?
Deactivate A Private Sub
Guys, I'm new to VBA and have been writing a program which opens an external workbook before copying data and importing into my workbook. The problem is, when the external workbook is opened and i select the requisite cells i wish to copy, my code appears to be overridden and it subsequently jumps to a private sub contained within the external workbook and stops running my code
Therefore my question would be is there any way i cn de-activate or skip the private subs contained within the external workbook?
Any help would be most appreciated
In a form shown as modal, there's a command button with this line of code:
Then, in Sub Form_Deactivate I had placed some code to perform a few cleanup operations. I thought the deactivate event would be triggered by Me.Hide, but it wasn't. Am I doing something wrong or is this like it should be?
Key Deactivate Problem
I would like to deactivate the windows & poppu menu key of the keyboard at a particular instance
Have you got any idea
I have used the API's setKeyBoardState, GetKeyboardState, but unable to get the result
What is the code to deactivate a workbook while my Shelled program is running. Coz I need to prevent the user from doing any form of actions(eg.clicking the menu bar)while my shelled program is running.I need to put the codes in a module.Can anyone help?Thanks.
Deactivate The <enter> Key In Access
I am using Access 2000 and have a couple of subforms that require data entry. I would like to prevent the user from filling out info in subform A and then pressing the <enter> key or any key that would update that subform. I want to force them to use a button inside that subform to save the record. your help is greatly appreciated!
Workbook Deactivate Event
I´m trying to deactivate or hide some controls in excel with a vb code.
I hide the controls when some sheets are activate with the code:
Private Sub Worksheet_Activate()
'some code. works fine
and then unhide the controls again with the code
Private Sub Worksheet_Deactivate()
'some code. works fine.
The problems is that if the sheet is not deactivate, but is the workbook that is deactivate, for example if I change to another workbook, the second code is never run and the controls remain on hide mode.
Im trying to run some code when I change to another woorkbook.
I tried to put the code in the App_WorkbookDeactivate() sub, but that subrutine doesn't run when I change to another workbook.
Private Sub App_WorkbookDeactivate()
'Code never run!
I also tried
App_WorkbookDeactivate(ByVal Wb As Workbook)
I´m placing this code in the sheet code.
It's possible to deacivate the ctrl+break in excel when running a VBA procedure?
How To Deactivate Excel Selection
exsh02 is my excel sheet
every time i resuse these codes they give me a
object variable or with block variable not set
although i already quit my excel application it still give me the error
ex01 is my excel.application
it seems like the activesheet is still refering to the previous activated sheet exsh02 ...
so is there a way to deactivate this selection?
i really need to solve this as i have many usage of this activesheet / activewindow ... etc in my program.
pls help anyone!!
LostFocus && Deactivate Not Working
I need a form to display a message box asking a user to save their work when the form loses focus. I tried both th Form_LostFocus and Form_Deactivate events and neither one was triggered. What am I doing wrong?
How Do I Deactivate Screensaver Password?
I want to deactivate the screensaver password.. I know how to Turn on/off the screensaver using api using SystemParametersInfo, but to deactivate the password is another matter.
Thanks for the help.
Oh ya.. this will be for WinNT or Win2k
Application Deactivate Event?
Is there an application EVENT which determines if the focus of an application has been lost? Such as the form_deactivate event but for the entire application.
What I want to do is, if the application has lost focus/deactivated then I wan to bring the focus back immediately, i.e. something like an annoying popup that never goes away
Also, if this can be done via the API only, this is an acceptable solution.
Deactivate? Lost Focus?
I have a small strip of buttons that have other forms as dropdown menus.
They all have the 'Always on top' set. Is there a way to trigger an unload or something when the focus is give to another app?
I have tried Deactivate....Nope
I know I could use a timer....but. I would rather not.
Any help would be great
Deactivate Screen Saver
I have a program that recieves testing results from an extrenal machine.
The program performs calculations and displays Pass/Fail and other
information to a user. We have the screen saver running when testing it
not being performed. Is there a way to have the program signal to the
system to deactivate the screensaver when recieving data.
When I say deactivate, I mean as on your PC. After X number of minutes the
screen saver starts. You hit the mouse of keybaord and it deactivates.
Hutchinson FTS Inc
Phone: 931.823.7838 x2230
Completely Deactivate An Application
I want to make an application behave like "dead" for a specific time.
Background: I want to start an external program and my application should behave as if I just had opened a new form modally (using "Show 1") until the program is closed.
If I e.g. disable the form for this time, I can't work with it but nevertheless I can click on it and it will come to the front.
Does anybody know a way to make the application ignore mouse clicks and stay in the background?
Thanks in advance
Deactivate Close Button
I would like to deactivate the close and maximize button of an application. But, using form properties I can disable maximize button and using the following code I can decativate the close button. But, Alt+F4 is not working to close an Application. I can not use any extra button to close an app. The code is givenbelow. The code works for a new form. But if i use it in my app it is not working. Can you please suggest? Thanks in advance.
Private Sub form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF4 Then
'ControlBox = True
'closebutton = True
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
Cancel = True
Can't Deactivate Ole Chart Embedded In Word
I can insert and manipulate an Excel Chart in word using the following code:
wd.Selection.InlineShapes.AddOLEObject ClassType:="Excel.Chart.8", FileName:= _
"", LinkToFile:=False, DisplayAsIcon:=False
numPlots = wd.ActiveDocument.InlineShapes.count
Set objC = .object
However, when I'm done doing stuff to the Excel Chart, I can't seem to write code to deactivate the ole object. It just stays activated (e.g. displayed as a workbook with a chart sheet and a worksheet). I can actually do stuff in Work programmatically while the Excel Chart is activated, but I wish to close/deactivate the chart so that the users sees only the ole chart.
Any help would be appreciated. Thanx!
Deactivate Right Mouse Click For Active X
I thought I stumbled on some code for this but I can't find it anymore.
I want to be able to have a right click event open a menu in an Active X control that is embedded in a web page. So far what I get is the popup menu I want as well as the menu that opens when you right click in the browser window. How does one make the right click specific to the Active X control?
Deactivate Event Not Limited Inside Vb
I am making a VB6 project.
I allso use Word automation.
I want to use the deactivate event,
only this is only triggered among the vb forms and is not triggered when going to my Word document. Is there a solution for.
The problem i have is the following. When the focus is on my VB form and cursor is on a textbox when i move from the VBform to my Word document i want logically trigger the textbox_validate event. But because the cursor stays in the textbox of my vb form the validate event is not triggerd, alternatively i was looking a way to use the vbform deactivate event but this allso isn't triggerd
Screensaver Activate/Deactivate Event
Does anybody know of a way how I could create an event which fires when the screensaver is activated and deactivated.
Edited by - glennandrewcooper on 2/8/2004 3:27:37 AM
DeActivate Event: Using Selections In The Workbook That's Being Deactivated.
I'm trying to write some code for the DeActivate event of a certain workbook. The problem is that the code should use the values in some cells of the workbook that is being deactivated. I cannot seem to activate the workbook from the DeActivate event's code. The values are on an invisible sheet, and I would like to select them (the values represent indexnumbers of toolbars that I want to make visible). What should I do?
Deactivate/activate Code In Excel Files
is there a way to deactivate code (excluding the use of comments) in a master file and then activate (or automatically insert) the code as the file is transformed and creates new files? i am basically using macros in a master file to repackage select sheets and create smaller files, but i need the module of code to only be active/inserted in the smaller files. thanks!
WebBrowser Control - Deactivate IE Browser Cache
I use the webbrowser control in my vb application. The problem is, that if the cache is activated in the Internet Explorer, the webbrowser controll will get the page from the cache, not from the internet. How can I stop this or how to deactivate the cache from the vb application? Is there something like webbrowser1.cache = False ?
Why It Reset Program After Deactivate The Screen Saver?
I tried to deacitvate the screen saver using following program. It works. However, it won't run continuously since I just have one timer on the former. It deactivate the screen saver and reset to IDE enviroment. Would somebody be kind to help me out?
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Const comWM_SYSCOMMAND = &H112&
Const cSC_SCREENSAVE = &HF140&
Const SC_CLOSE = &HF060&
Private Sub Timer1_Timer()
Dim lResult As Long
'lResult = SendMessage(Me.hWnd, comWM_SYSCOMMAND, cSC_SCREENSAVE, 0&)
lResult = SendMessage(Me.hWnd, comWM_SYSCOMMAND, SC_CLOSE, 0&)
How Can I Activate/deactivate A Device Connected To LPT1 With Vb?
My requirement is to activate an external device say, MP3 player for
half an hour after that it should be deactived and also by default it
should be deactivated. How can I do this? Pls specify the dll for this?
After all it is a timer related switching s/w!!!
Thanxs in advance
How To Make The Timer Activate Then DEACTIVATE After Button Is Released
Hey I am making a pong game (for a school project) I can get the ball to bounce randomly off all four walls and now I need to make the handle respond to the arrow keys. I know how to get the arrow keys to put a value into my variable. But how do i make the timer only activate when the key is down and Deactivate when the key is released?
Im sorry if this is confusing its fairly hard to explain. Let me try to sum up.
-Need to make handle move
-Know how to make the up arrow key add a value to my current variable.
-But need to make the timer control activate and deactive when the button is pressed and released... Or is this even how I would go about doing this?
Please try to understand
Activate/Deactivate Event Doesn't Fire When MDI Child
Please someone help me,
my problem is the following:
i had a nice application (it still is), but my boss wanted it to be an MDI Application, I say: 'No problem' and start changing some forms to MDI Child, but now, when my form is MDI Child, it DOESN'T do the (de)activate event, how is that possible?
Any ideas are welcome
Search before you ask - if you don't know where to search, ask before you search
Embedded Chart Selected - Workbook Deactivate Event Not Triggered In VBA
It seems that if you have an embedded chart selected on a worksheet that the Workbook_Deactivate() event is not triggered.
Originally I thought this behavior was a coding error, so I set up a simple sheet with 1 chart on it and the Workbook_Deactivate() and Workbook_Activate() events with a Msgbox command in both events to indicate when I enter them. Turns out that if the chart is selected, the Workbook_Deactivate() event doesn't trigger when switching workbooks, but the Workbook_Activate() event does trigger when coming back in. When the chart is not selected, both trigger. This is really non-intuitive to me as you can't set a chart event on an embedded chart without creating an event class (as far as I know).
I did create an event class just to check it out and it works (myChartClass_Deactivate()). However, that means I would need to set every embedded chart in my workbook to the class??? and also set a Workbook_SheetActivate event to catch for when I just deselect a chart and do not leave the workbook ("If ActiveWorkbook.Name <> ThisWorkbook.Name Then ..." works as I only care about the chart deactivate event to indicate that I left the workbook).
This can't be correct. Am I missing something here or is that what you really need to do?
thx in advance
Help In Home Network.. Deactivate The Prompt But Can Still View The Netwrk Neighbor?
if you have a lan.. is there a way that the network login prompt will not appear. the one that has a pc name and a passwrd and an icon of network neighbourhood in the left.. if you cancel it, then you can't view the network but if you click ok (btw, the network has no passwrd) you can view the netwrk neighborhood.. the problem is some people click cancel instead of ok so they can't view the netwrk neighborhood.. i want to create a program which relies on the reading of text files in a network.. if they click cancel then it won't work. because they can't view the shared files of the other pc.. so is there a way.. or a configuration that there'll be no prompt at all.. but still the computer can still view the network.. get my point..?? ty in advance
I Hv Put Window Media Player In Its Own Form...and Try To Access It Form Anotehr Form???
my concept is put window media player into its own form...then i would like to access its from my other form....
for example, i hv 10 form.......i create new form which named is frm11, then i drap window media player from toolbox into frm11.....
then in each of my form(frm1 to frm10) have a button which named"movie"...
and i would like frm1 to frm10 access to frm11's window medai player to play movie clip .for example"dog movie" because each form movie clip is difference.....for example frm3 is cat movie clip...frm 8 is snake,,,,,etc
the reason i would like to put windox media player into frm11 only is becauce i if i attach wmp in each form...my program sleed will be affectd....
thansk for teach me how to slove it...