473,382 Members | 1,814 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,382 software developers and data experts.

ActiveControl

UK
I have 3 command buttons on a form. I need to change the
caption of the active control. How do I access the
properties of the command button using ActiveControl? Or
is there a different method of doing this?

Thanks.

Jul 21 '05 #1
1 1900
You need to type-cast the active control to the correct
type. Try the following:

With CType(Me.ActiveControl, Button)
.Text = "SomeText"
.BackColor = Color.Red
.ForeColor = Color.White
End With

Good luck
-----Original Message-----
I have 3 command buttons on a form. I need to change the
caption of the active control. How do I access the
properties of the command button using ActiveControl? Or
is there a different method of doing this?

Thanks.

.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Chuck | last post by:
I have a form with 3 related fields. If data is entered into 1 field, the other 2 related fields are updated automatically. I would like to indicate on the form into which field the data was...
1
by: James Ramaley | last post by:
I am creating a ListView control at run-time and show it on my form. The control appears on the screen and responds to keyboard input. However, the form's ActiveControl method returns a reference...
1
by: UK | last post by:
I have 3 command buttons on a form. I need to change the caption of the active control. How do I access the properties of the command button using ActiveControl? Or is there a different method of...
2
by: Sam | last post by:
Hi, I have a MDI Application. The MDI parent contains a treeview control, and the childform contains a textbox. If I leave the textbox by clicking on the treeview, then...
0
by: Greg | last post by:
I'd like to know which contol the focus of a cell in a datagrid is being lost to. Querying ActiveControl.Name within the LostFocus event gives me a blank string, instead of the name of a button I...
4
by: Aphazel | last post by:
I got serveral textboxes in a form and want to copy/cut/paste text to clipboard from currently selected (focused) textbox. It's simple to cut/copy/paste when using specified control directly ie...
2
by: Bob Darlington | last post by:
When I run the following code from a continuous form's Current event: Set ctrl = Me.ActiveControl I get an error 2474 - 'The expression you entered requires the control to be in the active...
1
by: unknown; | last post by:
hello, i've got a question about active control. i'm buillding an application witch uses me.activeControl a few times to check some things. Now something strange happends.. when i click on...
3
by: nano2k | last post by:
Each form has its ActiveControl property, but no ActiveControlChanged event to signal that the active control has changed (like ParentChanged event). I tried to trick the form by declaring this...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.