473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Enable / Disable Button and using a timer to Enable a button and Erase data in TextBo

Hey Guys, Im trying to figure out how to Disable a Button after a user clicks it, then Enable the Button if the user emptys a Text Box where the user can input information. I also want to automaticaly Enable the Button and clear the Text Box if the user doesn't do anything for a specified amount of time after clicking the Button. Any Help with this would be appreciated. Thanks
Mar 20 '07 #1
2 6472
ansumansahu
149 100+
Hey Guys, Im trying to figure out how to Disable a Button after a user clicks it, then Enable the Button if the user emptys a Text Box where the user can input information. I also want to automaticaly Enable the Button and clear the Text Box if the user doesn't do anything for a specified amount of time after clicking the Button. Any Help with this would be appreciated. Thanks
Hi ,

In the Button1_Click function write what ever what you need to execute and then at the end you can have the code "Button1.Enabled = False". This would disable the button after you clicked it.

Similarly in the Text1_Change() I think you can have this set of code

If Text1.Text = "" Then
Button1.Enabled = True
End If

See if this helps.

thanks
ansuman
Mar 20 '07 #2
debasisdas
8,127 Expert 4TB
Hey Guys, Im trying to figure out how to Disable a Button after a user clicks it, then Enable the Button if the user emptys a Text Box where the user can input information. I also want to automaticaly Enable the Button and clear the Text Box if the user doesn't do anything for a specified amount of time after clicking the Button. Any Help with this would be appreciated. Thanks

Its so simple

TO DISABLE THE BUTTON
-----------------------------------------
in the button1_click() event
at the end specify button1.enabled=false

TO ENABLE IT BACK
--------------------------------------
in the textbox_change() event

if len(trim(text1.text))=0 then
button1.enable=true
end if

TO AUTOMATE
-----------------------------------
take one timer control
set interval to 5000 --if u wnat to exeute in 5 sec

in the timer1-timer() event

text1.text =""
button1.enbaled=true

and in the button click event

timer1.enabled =true


in form load


timer1.enabled=false


try this
hope it will work fine for u


regards
debasis
Mar 20 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
0
by: Big John | last post by:
I have not been able to successfully code a toggle button to enable /disable a record filter on a form.... I have been able to put seperate a button that will enable a record filter but cannot get...
2
by: Dntc | last post by:
Hi All Is there anyway to enable/disable the toolbar buttons on the fly as like in MFC which helps centralizing this process?Let's i have a toolbar button ToolbarButtonSave which can be...
2
by: JohnProgrammer | last post by:
I know I can fill the screen in VB.NET by starting my window maximized and without a border. My question is; in VB.NET is there a way to enable/disable the taskbar much like doing the "always on...
2
by: RootSpy2006 | last post by:
Hi All, Problem Definition: --------------------- Microsoft Wirelss Keyboard works in BIOS but does not work when booting into windows. Discovered Work-around: -----------------------------...
2
by: bartlomiej.szafraniec | last post by:
Hi! I'm trying to implement custom button. But I don't want to extend Button class. I want to extend Control class. I want to implement Enable disable functionality. But unfortunatly when...
2
by: rn5a | last post by:
In a shopping cart app, assume that a user has placed 4 orders (each order has a corresponding OrderID which will be unique). When he comes to MyCart.aspx, by default, the details of his last order...
1
by: solanki.chandrakant | last post by:
Hi All, i m working on Linux Fedora Core 4. i have to develop one program in that i have device id. Based on given device id i have to enable/disable particular device id. i have to work with...
1
by: inadsad | last post by:
Good Day, I have 2 forms with bindingNavigator and have a simple routine to enable/disable navigator buttons. Each nav button is assigned to a tag value. The problem is that if I want to...
2
by: premrajap | last post by:
How can i enable /disable the sort button of C# property grid??
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.