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




Enabling And Disabling Buttons


Hello,
I've been working on a project where employees have to punch in and punch out through buttons on a form. I managed (Thanx to Hack) to hook it up to a database that records the time where employees punched in and punched out. But, is there a way I can make the employee not accidentaly punch in or out twice. Perhaps by disabling the punch in button when this particular employee punches in and enabling it only if he punches out. Any code or advice would be really appreciated.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Enabling And Disabling Buttons
Hi, I would like to know the code for the procedure where there is a Print button which is ( enabled = false) and you hit a Calculate button and the Print button is ( enabled = true ) and vice versa.. thank you in advance

Enabling/Disabling Toolbar Buttons
Hey everyone,

I've searched the forum and have no luck, so here we go.

I'm working on an MDI application that has cut, copy, and paste buttons.

Obviously, the cut and copy buttons should not be enabled when a command button has the focus and other situations like that.

Is there anyway to do this other than in the GotFocus and LostFocus events of every control check to see if the active control is a textbox, if text is selected, etc etc etc.

I thought of using a timer to do this, and have code to check it in the Timer event, but that seems pretty inefficient.

Any ideas??

Thanks all.

Enabling And Disabling The Command Buttons
I have this line of code which I use to confirm network connectivity:

Dim ECHO As ICMP_ECHO_REPLY
   Dim pos As Long
   Dim success As Long
   
   If SocketsInitialize() Then
   
     'ping the ip passing the address, text
     'to send, and the ECHO structure.
      success = Ping("10.1.1.1", "Hello", ECHO)
      
     'display the results
           
      
      
      If Left$(ECHO.Data, 1) <> Chr$(0) Then
         pos = InStr(ECHO.Data, Chr$(0))
      
                      
      End If
               
      SocketsCleanup
      
      Text1.Text = "You are connected to the Network"
      
   Else
   
        MsgBox "Windows Sockets for 32 bit Windows " & _
               "environments is not successfully responding."


What I want to do is if the the network is available I want the command buttons to be enabled....I have them disabled by default.

Thanks in advance for your help

Enabling/Disabling Toolbar Buttons At Runtime
I am relatively new to Visual Basic and have recently started designing a practice application with one toolbar(Toolbar1). The buttons work fine but I need to enable or disable some buttons at runtime - For example, if 'Form1' is visible, the button to show that form needs to be disabled while enabling the button which shows 'Form2'. Can anyone help me out with this problem?

Enabling/ Disabling CapsLock
HI,

I'm making a game and i need to be able to turn on and off Capslock.

Anyone know any code to do this?

Thanks in advance,
Ed

Sstabs-enabling/disabling
Hi,
The folowing line of code is giving me nightmares .
Please tell me where I am goin wrong.

Code:
Tenant.Tab.TabEnabled(INCIDENT) = False

where tenant is the form name and incident is a tab on it.I have used sstabs.
i m getting error as - Method or data member not found.I have added all the requisite ocx/dll files but the problem persists.Please help.
thanx

Disabling And Enabling MSComm1_OnComm()...
Hi. I have been using MsComm1.RThreshold = 0 then 1 to disable then enable MsComm1.OnComm() comEvReceive event. However, since I am still getting premature triggering from inbuffer "junk", I am not sure if this is the correct solution?

I would like to first disable serial input interrupt, clear all "junk" from the buffer, then enable serial interrupt.

Is this the proper way of disabling and enabling MSComm1_OnComm() interrupt? Thank you.

Enabling && Disabling Frame
I've a frame in a form(Form1). Over that frame i've some other components (option buttons. text box). What i need is, when i disable the frame, components over the frame should also become disabled. How can i do this?.

Enabling And Disabling Combo Box
Greetings,

I am currently using Microsoft Office in order to create a few simple VB scripts. Since I do not have much experience with VB, I was looking to see if anyone could help me.

I've created a combo box that has "None", "One" and "Two" as the options. After selecting "One" I would like for a disabled combo box to become enabled so the user can input another option. If the user changes his/her mind and switches the option to "None" or 'Two", I would like for the combo box to disable itself again. I used the following code but it did not work:

Private Sub ComboBox1_GotFocus()
ComboBox1.Clear
ComboBox1.AddItem "None", 0
ComboBox1.AddItem "One", 1
ComboBox1.AddItem "Two", 2

If ComboBox1 = "One" Then
ComboBox2.Enabled = True
Else
ComboBox2.Enabled = False
End If

End Sub


I also tried placing the If ComboBox1= "One"...... code under the Private Sub ComboBox2_Click() and was unable to make it work that way.

If I need to post more detail, please let me know.

Thanks!

Enabling/Disabling Tooltips
I've looked around but haven't found an answer yet for this...

I've got a VB6 app that I would like to add ToolTips to - no problem there. However, I would like to give the user the ability to disable the ToolTips if they don't want them poping-up all the time. I have a user preferences file that I can store the info in, but don't know how to turn the tips off for a whole app.

Anyone got an idea?

Thanks.

Enabling/disabling A Control...
hey all,
I am using the WebBrowser1 control on my app. On the form that loads the control I would like to be able to check the registry for a setting (I have code to do this), then, either enable or disable the WebBrowser1 control.

Reason being is some users don't like any apps accessing the net, this way they can enable or disable that "feature".

TIA...

Enabling And Disabling Ports (TCP/IP,FTP) Using J
How can we enable and disable TCP/IP , FTP ports on the client machine using either Visual Basic or Java, and also how we can make different ports communicate with each other programmatically ? I am a new user please help me. Thanks...

Disabling And Re-enabling Toolbars
Working on an Excel project using VBA (have been for way too long now ) and one of it's features deals with the toolbars. Basically my project has it's own toolbar that will handle all of the functions that I want the user to have. And it disables everything else (and hopefully right-click too one of these days) so that a wandering user can't do other things to the sheet. However, I also realized that the user may be working with other excel sheets at the same time, so I wanted the toolbars to toggle...here's what I've got so far:

in the modules:
Code:
Private toolview() As Integer
Private isClosing As Integer

Sub Closing()
    isClosing = 1
End Sub
Sub Opening()
    isClosing = 0
End Sub

Sub turnoff()
For i = 1 To 9
MenuBars(xlWorksheet).Menus(i).Enabled = False
Next
cnt = 0
i = 0
For Each Control In Application.CommandBars
    cnt = cnt + 1
        If Control.Visible = True Then
            i = i + 1
            ReDim Preserve toolview(1 To i)
            toolview(i) = cnt
             If cnt <> 1 Then
                If cnt < 23 Then
            Control.Visible = False
            End If
        End If
        End If
Next Control
Application.CommandBars("Incentive").Visible = True
End Sub

Sub turnon()
If (isClosing = 0) Then
Application.CommandBars("Incentive").Visible = False
End If
For i = 1 To 9
MenuBars(xlWorksheet).Menus(i).Enabled = True
Next

For x = LBound(toolview) To UBound(toolview) 'Note: this is where the error occurs
Application.CommandBars(toolview(x)).Visible = True
Next
End Sub


Then in the workbook code:
Code:
Private Sub Workbook_Activate()
turnoff
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Closing
Toolbars("Incentive").Delete
End Sub

Private Sub Workbook_Deactivate()
turnon
End Sub

Private Sub Workbook_Open()
Opening
    Toolbars.Add ("Incentive")
    Toolbars("Incentive").Position = xlTop
    Toolbars("Incentive").ToolbarButtons.Add 2
    Toolbars("Incentive").ToolbarButtons.Add 3
    Toolbars("Incentive").ToolbarButtons.Add 9
    Toolbars("Incentive").ToolbarButtons.Add 244
    turnoff
End Sub


now, most of the time it works fine...it shuts off the custom toolbar when other sheets are active, and remembers what the user was using with their other sheets, turns those on. Toggle back to my sheet, and it reactivates the custom toolbar and disables everything else. However, sometimes, like when one sheet is open and then I open this one, and toggle, and then close this one. It comes up with errors. Sometimes it just doesn't remember what the user had running....other times it comes up with subscript out of range errors in the toolview array. I'm brainfried like usual, and thought maybe you folks could take a gander at it, and see if there is something blatantly wrong with the code etc. ANY suggestions or ANY advice would be GREATLY appreciated. Thanks!

Enabling/disabling Internet In LAN
Hi vb guys! I would like to ask for ur help... I have this problem, how can enable/disable the Internet connection of a client or all of the clients from the server? Need help pretty badly... Thanks

Enabling/Disabling Screensaver
How can VB control the screensaver (Windows 95 platform)? I need to disable the screensaver when a specific window is displayed and re-enable screensaver when that window is unloaded.
Thanks for any help.
d

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

Enabling/Disabling Autoplay From Registry
Apparently it is possible to do this programaticaly (Microsoft KB Article ID: Q150449). Why am I unable to do this without crashing VB6? Autoplay hasn't worked on my machine for some time. Could somebody please bash this code out and send me the example (The key in question is in the article, along with all the API functions and key changes necessary. I just can't do it ...)? Much appreciated!

Enabling And Disabling Cells In MSFlexgrid
Just a quick question: -

How do I disable a cell in a MSFlexgrid.

basically when I click on cell (2,2) it changes its value from 0 to 1
-I want cells (2,3) and (2,4) to be disabled so when i click on those cells values will not change from 0 to 1

and then if I click on the cell and change its value from 1 to 0 I want to enable those cells again!

I hope there is a quick way of doing this!

Eb

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/Enabling The Keyboard Or Mouse
Help needed for the following command

Disabling/Enabling The Keyboard and Mouse :::

Thanks

Disabling/enabling Ctrl+alt+del - Urgent
hi,
I tried using the SystemParameterInfo API to disable ctrl+alt+del and the WIndows key.

The code i used was:

SystemParametersInfo(97, bDisabled, ByVal 0&, 0)

I also tried:

SystemParametersInfo(97, bDisabled, CStr(1), 0)

Where bDisabled was true for disabling and false for enabling.

The former caused the system to hang(I had to restart everytime) and the latter gave me an error saying that "VB has performed an illegal operation and will be shut down"

Can someone help me out here?

Im using vb6 with windows95.

Thanks in advance,
Ramya.

P.S. Is there any way this can be done with NT???

This Is About Enabling And Disabling Text Boxes
This might sound like a dumb question but I am doing a database and I want the user to only beable to use the text box when they click on add new record or delete record or update record.
I just want to know what the code would be for this.
Thank you.

Enabling And Disabling Menu Options
I have a menu with 3 parent options and about 4 child options under each of them. Based on the access, the child options should be enabled/disabled or when all the child options do not have access, the respective parent option should be disabled.
how to go about this.

Parent Menu -> MASTER TRANSACTION UTILITIES
Child Options-> Item Invoice Import
                           Product Payment Export
                           Vendor Receipt Backup
                                                      Payment Restore

Above is the look of the sample menu.

How to go about it in visual basic

Thanks in advance,

 

Enabling/Disabling Network Components
Hello,

Can anyone tell me how to enable/disable network component programatically (Win32/MFC)? I have attached an Image which shows about 2 network components one is local Ethernet and another one is WiFi wireless LAN. I need change among these. How ?


Thanks,
Vikas

Disabling/Re-enabling Copy && Paste Functions
Greetings,

I have created an Excel based survey system whereby people are sent individual surveys in Excel and return them to me. From there, I use another workbook to compile the data using a macro which goes from sheet to sheet copying the data.

In an effort to control responses, I have disabled copy and paste functions in each individual survey with the following code:


Code:
Private Sub Workbook_Activate()

Dim octrl As Office.CommandBarControl

'Disable all Cut Menus
For Each octrl In Application.CommandBars.FindControls(ID:=21)
octrl.Enabled = False
Next octrl

'Disable all Copy Menus
For Each octrl In Application.CommandBars.FindControls(ID:=19)
octrl.Enabled = False
Next octrl

'Disable all Paste Menus
For Each octrl In Application.CommandBars.FindControls(ID:=22)
octrl.Enabled = False
Next octrl

'Disable all Paste Special Menus
For Each octrl In Application.CommandBars.FindControls(ID:=755)
octrl.Enabled = False
Next octrl

'Disable the Edit Menu
For Each octrl In Application.CommandBars.FindControls(ID:=30003)
octrl.Enabled = False
Next octrl

Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.CellDragAndDrop = False

End Sub

Private Sub workbook_Deactivate()

Dim octrl As Office.CommandBarControl

'Enable all Cut Menus
For Each octrl In Application.CommandBars.FindControls(ID:=21)
octrl.Enabled = True
Next octrl

'Enable all Cut Menus
For Each octrl In Application.CommandBars.FindControls(ID:=19)
octrl.Enabled = True
Next octrl

'Disable all Paste Menus
For Each octrl In Application.CommandBars.FindControls(ID:=22)
octrl.Enabled = True
Next octrl

'Disable all Paste Special Menus
For Each octrl In Application.CommandBars.FindControls(ID:=755)
octrl.Enabled = True
Next octrl

'Enable the Edit Menu
For Each octrl In Application.CommandBars.FindControls(ID:=30003)
octrl.Enabled = True
Next octrl

Application.OnKey "^c"
Application.OnKey "^v"
Application.CellDragAndDrop = True

End Sub

Private Sub workbook_sheetselectionchange(ByVal sh As Object, ByVal target As Range)
With Application
.CellDragAndDrop = False
.CutCopyMode = False
End With
End Sub
My data compiling macro is as follows:


Code:
Sub Transfer()

Application.ScreenUpdating = False

x = False
NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please Select a file")
Do While NewFN <> False
NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please Select a file")
If NewFN = False Then
Exit Sub
Else
Workbooks.Open Filename:=NewFN
End If

Sheets("DATA - 8").Activate
Range("A6:AV25").Select
Selection.Copy
Windows("Database Template.xls").Activate
Range("A6").Select
ActiveSheet.Range("F6").Select
Do While ActiveCell <> 0
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Offset(0,-5).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.ActivatePrevious

Application.ScreenUpdating = True

Application.CutCopyMode = False
ActiveWindow.Close False

Loop

End Sub
My problem is that since copy and paste is disabled on each individual workbook, I cannot use the paste special function to transfer the data in my compiling macro. I have attempted various ways to reactivate copy and paste so I can transfer that data, but I haven't been successful. Is there any way to run a macro in a workbook from another workbook? Any insight would be much appreciated!!!

Plz Help In Enabling / Disabling Sound Card Using VB Code
plz i need any way to enable and disable sound card or cd rom using visual basic code plz any person to help me im in truble now

Enabling/Disabling Shutdown Button *RESOLVED*
I ran a source code with API to disable shut down / log off / password change / task manager, and then re enable, but it won't re enable my shut down button, so I have no way of turning off my computer without pushing the botton on my physical system. Does anyone know how to re enable the shut down button? I have the source for the program that did it. It re enabled task manager but didn't re enabled the damn shut down button!

Menu Enabling/disabling In MDI Parent Error
OK, again I must show a grey area in my knowledge of Visual Basic 6.

I am tryign to ensure that a drop-down menu in the MDI parent is disabled when loading an MDI child form, as the drop-down menu would be inappropriate for that particular form and I don't want users (who we all know do stupid things at times) trying to do things that would casue things to fall over.

Now, normally the following line of code should work.


VB Code:
frmMain.mnuJump.Enabled = False


When I start typing that in, VB6 continues to fill in the blanks for me.

Yet, when I try and load the form, it stops at that line, and gives me a Run-Time Error 426: "Only one MDI Form allowed".

I've seen two possible solutions to this problem online, both with very flaky explanations (is it just me or is this some sort of common problem among many VB sites - solutions that probably work with explanations that don't make sense to somebody else trying to work their own problems out). The solutions are:
[list=a][*]Turn the menu into a public property (I've got NFI how to do this with a menu)[*]Turn my forms into MDI children, which they already are so that's not the solution.[/list=a]

Any ideas???

Enabling And Disabling Proxy Server Through Visual Basic
hello, im currently studying at uni and i need to use a proxy server there, however when im at home i dont require a proxy, i would like to develop a little application that sits in my task bar and automattically checks to see which network i'm on, this could be done by checking the first 3 numbers of my ip, i know how to do all of this, the bit im stuck on is how to access the internet options to change the proxy server, any help would be great,

thanks alot

Enabling/Disabling Start Button On Windows 2000
I am looking for the API(s) and sample code that I can use that will allow me to enable and disable the windows start button.  The reason is I am helping a friend of mine whose primary tech support person recently passed away, and he disables the start button upon loging (I assume).  I was hoping to:

1) understand how that can happen
2) have a temp solution to enable it to perform some admin task - such as backup the server

Any help would be appreciated.  Thank you.

Urgent Help - TreeView Enabling/Disabling Child Nodes
I'm trying to load a treeview that has upto 4 levels. The requirement is, while loading the treeview, i need to enable the Level 3 and level 4 and disable the rest.
I know that we have Treeview.enabled = false but is it possible to use this at various levels.

Root
Parent1
    AA
    BB
        BB1
            BB12

In the above, i need to enable bb1 and bb12 and disable the rest. Also, is it possible to show the treeview as expanded with the selection that was already made.
be it that im loading the treeview in a View mode where the user has already made a selection of BB12. Can the treeview be expanded while loading the second time based on the mode?

Pls provide inputs.
  

Enabling Buttons ---Please Help
Hi
Im doing a college assignment and am having difficulty making my buttons
operate in a coherent manner.

I need to be able to enable the update button only after the Add or Edit buttons have pressed (the Add and Edit buttons subsequently become disabled) .

Here is the code so far.
My buttons are cmdAdd_Click(), CmdUpd_Click(),cmdEdit_Click() and cmdDelete_Click()

I would appreciate any help



Private Sub cmdAdd_Click()
Dataemployee.Recordset.AddNew



End Sub

Private Sub cmdDelete_Click()

With Dataemployee.Recordset
If MsgBox(" Are you sure you want to delete " + .Fields("Surname") + _
"?", vbYesNo) = vbYes Then
.Delete
MsgBox ("Record Deleted")
.MoveNext
If .EOF Then .MoveLast
End If
End With

End Sub

Private Sub cmdExit_Click()
End

End Sub

Private Sub cmdLast_Click()


Dataemployee.Recordset.MoveLast


End Sub

Private Sub cmdMfirst_Click()

Dataemployee.Recordset.MoveFirst



End Sub

Private Sub cmdNext_Click()

Dataemployee.Recordset.MoveNext
If Dataemployee.Recordset.EOF Then
MsgBox "This is the last record"

Dataemployee.Recordset.MoveLast

End If
End Sub

Private Sub cmdPrev_Click()
Dataemployee.Recordset.MovePrevious
If Dataemployee.Recordset.BOF Then
MsgBox "This is the first record"
Dataemployee.Recordset.MoveFirst

End If

End Sub


Private Sub cmdQuery_Click()
frmQuery.Show 1

End Sub

Private Sub cmdRefresh_Click()
Dataemployee.Refresh
End Sub

Private Sub CmdUpd_Click()
Dataemployee.Recordset.Update
End Sub

Enabling Buttons At Random?
Hi,
I have a form with 47 buttons on it, all except 1 are disabled when the form loads.

What i am trying to do:
When a user clicks the button, a random number (between 1- 4) buttons will be randomly enabled.

How do i do that?

Thanks
-abxccd

Enabling Buttons After Change
I have a form with textboxes and comboboxes. When the form loads for the first time none of the controls are populated with values so the print and save buttons are disabled. As soon as a key value is inserted in the first textbox the print button only is enabled. I need to enable the save button only if the value of one of the textboxes or comboboxes change. I cannot use the change event of these controls since a few of them populate automatically if the key value matches an existing value in the database. Is there a way of enabling the save button after a change is made once the form is loaded? Thanks!!

Enabling Option Buttons
Hello all

I have in my project 3 option buttons which describe the buildings in which the user chooses, "The Forge" ,"st. Pauls" and "The Riverside" , with the thanks of VB City ive managed to create a control array and enter the users choice into a variable array
Code:
Select Case intBuilding
Case 0
recLocation(intFileno).strSite = "The Forge"
Case 1
recLocation(intFileno).strSite = "st. Pauls"
Case 2
recLocation(intFileno).strSite = "The Riverside"
End Select

So far i have managed to then add the name of the part from the array to a list box so that when the user clicks on the Part name the rest of the entry is then displayed in the appropriate txt boxes, what i cant do however is then check the correct option button in the control array that relates to that entry.

Example
Array Entry = Modem, £15, The Forge
I can enter the name into the list box on form load and when the user clicks on this i can enter the price into a txt box but i cant check the option button to show the user that it belongs in "The Forge".

Can anyone help please
chris

Enabling Buttons While Selecting Tabs
Morning people,

*yawn*

Woke up this morning with code running through my head (is it a bad thing when you dream in code?). Anyway, my problem goes as follows:

I am using Microsoft Tab Control Dialog 6.0. My form contains 4 tabs and three command buttons outside the tabs. What I want to do is after the user leaves tab 0 and moves to one of the other tabs - make the cmdButton1.enabled = false. Then when the user returns back to tab 0 have that command button enabled again.

I am lost as to how the Tab Control Dialog functions in this way. As an educated guess I'd say that this is an indexing issue but again I can't quite seem to make it work. Any help is appreciated.

Cheers
FreshFlesh

Disabling Buttons
I have a couple of questions,

1. I want a button to be disabled until i enter text into a text box the code that i have tried is as follows:

If Text1.Text <> "" Then
btnSearch.Enabled = True
Else: btnSearch.Enabled = False
End If

I have put this into the form load function but the button is always disabled, when i put it into the onclick button procedure it works but only when i click the buton, any ideas on how this wuold work in form load.

2. Can anyone tell me how to have my forms text boxes clear on form load as they are connected to a data source but i dont want then to show data as soon as the form is loaded.


Cheers

Disabling Buttons
Greetings, coding Gods!

I have some reporting MDB with one form and two buttons.
Reporting query runs for minute or two, and I wanted to disable both of the buttons to prevent user pressing them.

Of course, Code:[Control name].Enabled = False is the thing to use.

But as you can't disable currently focused control and you can't focus currently disabled control, I can disable only one button.
Is here any way to disable both?



-----------------------------------------------------------------
Making mistakes is one of the ways of improvement.
GL and HF

Edited by - un5killed on 3/5/2006 11:23:07 PM

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 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 The Arrow Buttons
Hey all. I was wondering if this is possible. Can you disable the keyboard while Windows Media Player is on? I have an autistic nephew who watches movies on his computer and constantly rewinds the movies by hitting the arrow keys and his parents hate it. I've read through the other posts and it doesnt seem like disabling the keyboard is possible unless you reboot everytime you disable it. Would it be possible to have a form with two buttons, one for disabling the keyboard and one for enabling the keyboard? If disabling the whole keyboard isnt possible is it possible to disable and enable the arrow keys? I would greatly appreciate any help you guys provide. Thanks

Disabling Navigation Buttons At EOF Or BOF
i want to disable movenext button once it displays the last record

Disabling Buttons On Collision
i want it to disable the "offending" button if it is the one that was used to hit the object...both the "ball" and the "wall" are just command buttons
could someone please help me ive spent 4 hours making attempts at this

VB Code:
'Defining StuffOption ExplicitDim dx As Integer, dy As Integer, speed As IntegerDim dgo As BooleanDim sgo As BooleanDim ago As BooleanDim wgo As BooleanDim Over(1 To 2) As Boolean, Overlap As BooleanPrivate Sub Form_Load()dx = 5dy = 5speed = 100KeyPreview = Truedgo = Trueago = Truewgo = Truesgo = TrueEnd SubPrivate Sub Form_KeyPress(KeyAscii As Integer)Over(1) = False 'The mouse is not within the square unless all conditions below are met 'Collision detection with ball (pacman) & wall If KeyAscii = Asc("a") And ago = True Then    ball.Left = ball.Left - speedEnd IfIf KeyAscii = Asc("d") And dgo = True Then    ball.Left = ball.Left + speedEnd IfIf KeyAscii = Asc("w") And wgo = True Then    ball.Top = ball.Top - speedEnd IfIf KeyAscii = Asc("s") And sgo = True Then    ball.Top = ball.Top + speedEnd IfIf ball.Left > Form1.ScaleWidth Then ball.Left = 0If ball.Left < 0 - ball.Width Then ball.Left = Form1.ScaleWidth    If ball.Left <= wall.Left + wall.Width Then        If ball.Left + ball.Width >= wall.Left Then            If ball.Top <= wall.Top + wall.Height Then                If ball.Top + ball.Height >= wall.Top Then                    Overlap = True                End If            End If        End If    End If    If Overlap = True Then    MsgBox "hi"       End If        Overlap = FalseEnd Sub

Disabling Mouse Buttons
Is there a way to temporarily disable the left and right mouse buttons?

Thanks

Disabling Command Buttons Through An Array...
--Boundary_(ID_a0lkS2SlVjjt0OFtDbyVnQ)
Content-type: text/plain; charset=Windows-1252
Content-transfer-encoding: 7BIT

Hi Victor,
I tried your code in VB and got the same error, but this code surely
works.

Private Sub Form_click()
Dim ctl as control
For each ctl in Me.controls
If typeof ctl is commandbutton then
ctl.visible = false
End if
Next ctl

End Sub

The same can work for other controls as such:
If typeof ctl is textbox then /
If typeof ctl is checkbox then /, etc.

let me know if the above code worked for you or not.
Regards,
Sameer.

SAMEER KHAN,
ASSISTANT E.D.P. MANAGER,
JASHANMAL & PARTNERS LTD.,
Tel.No. 822225 Extn. 307,
Email: email@removed


--Boundary_(ID_a0lkS2SlVjjt0OFtDbyVnQ)
Content-type: text/html; charset=Windows-1252
Content-transfer-encoding: 7BIT

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Windows-1252">
<TITLE>Message</TITLE>

<META content="MSHTML 5.00.2919.6307" name=GENERATOR></HEAD>
<BODY style="COLOR: #000000; FONT-FAMILY: " stationery_tag_mark>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>Hi
Victor,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>  I tried your
code in VB and got the same error, but this code surely
works.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class0260009-11092003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>Private Sub
Form_click()</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>  Dim ctl as
control</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>   For
each ctl in Me.controls</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class0260009-11092003>     If typeof ctl is commandbutton
then</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class0260009-11092003>    &n bsp;  ctl.visible =
false</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class0260009-11092003>     End if </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>   Next
ctl</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class0260009-11092003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>End
Sub</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>The same can work
for other controls as such:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>  If typeof ctl
is textbox then /</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>  If typeof ctl
is checkbox then /, etc.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class0260009-11092003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class0260009-11092003>let me know if the
above code worked for you or not. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class0260009-11092003>Regards,</SPAN></FONT></DI V>
<DIV><FONT face=Arial size=2><SPAN
class0260009-11092003>Sameer.</SPAN></FONT></DIV >
<DIV><FONT face=Arial size=2><SPAN
class0260009-11092003></SPAN></FONT> </DIV>
<DIV align=left dir=ltr><FONT face=Arial
size=2><STRONG>SAMEER KHAN,</STRONG></FONT></D IV>
<DIV align=left dir=ltr><FONT face=Arial size=2>ASSISTANT E.D.P.
MANAGER,</FONT></DIV>
<DIV align=left dir=ltr><FONT face=Arial size=2>JASHANMAL & PARTNERS
LTD.,</FONT></DIV>
<DIV align=left dir=ltr><FONT face=Arial size=2>Tel.No. 822225 Extn.
307,</FONT></DIV>
<DIV align=left dir=ltr><FONT face=Arial size=2>Email: <A
href="mailto: email@removed ">sameer@jashanmal .net</A></FONT></DIV>
<DIV align=left dir=ltr> </DIV><!--mail_content--></BODY></HTM L>

--Boundary_(ID_a0lkS2SlVjjt0OFtDbyVnQ)--

Disabling Minimize And Restore Buttons
I am eager to know that how can we disable minimize and restore buttons of a form. I am trying to cover all the screen (including start menu) by my MDI form using following code:

Private Sub MDIForm_Resize()
Me.Top = 0
Me.Left = 0
Me.Height = Screen.Height
Me.Width = Screen.Width
End Sub

This code works b'coz i have set windowstate to normal. But when i click on restore or minimize button an error message displays 'A form can't be moved while minimizing or maximizing'.

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 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 Vb Default Print And Export Buttons In Report View
Hi guys

I have searched but could not find.

Could any one tell me if this is possible, and if, with the least amount of code. Or direct me to a previous discussion on this matter.

The reason for this is I want to distribute a few demo versions of my app. All I want to do is to disable a few buttons here and there including the print and export buttons in report view.

This will save me the hassle of creating a trial version.

Thanks
Pieter

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