473,402 Members | 2,064 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,402 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 1901
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.