473,651 Members | 3,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Focus of RadioButton

On my Form I have several Panels with several RadioButtons on it. When
I start the Form, on each Panel a RadioButton should be selected if
it was selected when I called the Form some time ago.

Problem:
How can I force that the focus remains on a specific RadioButton after
it is selected? (so that also the text is surrounded by the dotted
line as it is the case when you reach a RadioButton by TAB).
At the moment the focus goes away after selecting and resides on some
father component.

Attention:
I do have to rebuild the Form dynamically every time a RadioButton is
clicked because depending on a click the appearance of the Form may
change!
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #1
3 1572
Save the current settings of the RadioButtons on the form in a file in the
local user's data folder (see the Application.Loc alUserAppDataPa th property)
before closing the form, and read those settings when the form opens. You
can include a value that lets you know which (if any) of the RadioButtons
has the focus. The first time the form runs for any given user, the file
won't be there, so you'll need to handle that condition (or other errors
during the read), and display the form in its default configuration.

"jahuer1" <ja*****@yaho o-dot-com.no-spam.invalid> wrote in message
news:40******** **@Usenet.com.. .
On my Form I have several Panels with several RadioButtons on it. When
I start the Form, on each Panel a RadioButton should be selected if
it was selected when I called the Form some time ago.

Problem:
How can I force that the focus remains on a specific RadioButton after
it is selected? (so that also the text is surrounded by the dotted
line as it is the case when you reach a RadioButton by TAB).
At the moment the focus goes away after selecting and resides on some
father component.

Attention:
I do have to rebuild the Form dynamically every time a RadioButton is
clicked because depending on a click the appearance of the Form may
change!
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 20 '05 #2
Well this is not really the point. I do save my configuration and then
enter my form with:

dim QForm as new Form
QForm.initTheFo rm(mySettings)
...etc.

The point is that after I set the right RadioButtons, the focus goes
away:
(in initTheForm):

for i=0 to myPanels.GetUpp erBound(0)
with myPanels(i)
for j=0 to .radiobtns.GetU pperBound(0)
if mySettings(i,j) then
.radiobtns(j).c hecked=true
endif
next
end with
next

On my point of view, focus should remain on the last RadioButton that
"checked" was set to TRUE. But it isn't. It seems as it is on the
father Panel of this RadioButton. At least it surely does not look
like as if I enter the Panel after some TAB's. Only then it is really
focused and the dotted grid-line appears.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 20 '05 #3
* ja*****@yahoo-dot-com.no-spam.invalid (jahuer1) scripsit:
[...]

Why not address your posts to everybody in this group? For private
communication, use email.

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!
Nov 20 '05 #4

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

Similar topics

8
2841
by: VK | last post by:
Hi! What I'm missing in following code? Cannot get the values of radiobuttons. Starting only one class (GetVariant), it works. When I put two classes together, it doesn't. Regards, VK from Tkinter import * class GetVariant: def __init__(self): self.root = Tk()
3
36175
by: sofie | last post by:
Hello all, I use the following javascript function in a html document to set the level of one of eight available radiobuttons. The line that's commented out works fine under IE, but I need to rewrite it so that it's W3C compliant. Reading through earlier messages I concluded I should go with getElementById but this doesn't work. What am I doing wrong? Your help is much appreciated.
3
1976
by: Hrvoje Voda | last post by:
I would like to when I click radioButton selectFocus on textBox. How? Hrcko
2
5412
by: Amit D.Shinde | last post by:
I am having 4 controls on my form name and tab index property of them is as follows Name Tabindex Textbox1 0 Radiobutton1 1 Radiobutton2 2 Button1 3
0
1542
by: LCAdeveloper | last post by:
Another newbie question I'm afraid. When I use the .Focus() or .Select() methods to set the initial control that has focus on a form, try as I might I cannot get the control to visually indicate that it has the focus (e.g. a dotted outline around the caption of a RadioButton). The visible and enabled properties are set to true, and I know that the desired control has the focus (in this case one of two or more RadioButtons located in a...
1
2180
by: osmarjunior | last post by:
I override the OnShown event of a form and call both methods Select() and Focus() of a RadioButton. The RadioButton is selected, but the focus rect is not visible. If I press Tab key to exit the RadioButton, and press Shift+Tab to back to the control, then the focus rect is visible... But I wanna make the focus rect visible as soon as the form is shown. How can I ensure this? Thanks.
5
11644
by: Matt B | last post by:
I know this is a bit of nonstandard behavior, but I would like the Enter key to move focus through a group of radiobuttons without selecting them. The user would then have to use Space or actually click to select one of the radiobuttons to select. The default behavior of Focus() seems to also select the radiobutton, but I can't seem to find what is causing this to happen. I would like very much to seperate the Focus and the selection....
0
1780
by: BizEd | last post by:
I have a textbox that fires an autopostback when filled in. The next field after the textbox is a RadioButtonList which I set focus to. The radiobutton list does have focus and activates when you hit the spacebar, but the little selection box does not appear around the first item like it does when you tab to a radiobutton list. So in essence, the user has no idea where they are on the screen. I've tried both the focus() method and...
5
3918
by: andersond | last post by:
I have a screen that begins with a radiobutton. For some reason it does not accept focus until the tab key is pressed. I use a js line to assign focus to the radiobutton but the radiobutton does not accept it. All my other pages have focus set on the first object when the page is displayed. What can I do to cause the radiobutton to have focus? Here's the code line I am now using: ...
0
8278
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8807
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8466
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7299
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.