-
Default property problem
Hi all,
For the first time I am creating a control with the Default property and it
doesn´t work at run time. At authoring time I set the DefaultCancel property
to True and the container add the Default and Cancel properties to the
extender object. At design time I can set Default and Cancel properties but
at run time it doesn't work: the control that has TabIndex = 0 becomes the
default control and has the focus. This happens to all of the controls that
have the Default property when one instance of my control is present in the
container.
Example: I put a control (mine) and a Command button on a form and set the
control's Default property to False but if it's TabIndex is = 0, at run time
as the form is loaded the control gets the focus.
I found that the property UserControl.Ambient.DisplayAsDefault is unchanged
till the Show event is fired. The sequence of events is this:
1 - ReadProperties event: (DisplayAsDefault = False)
2 - Resize event (DisplayAsDefault = False)
3 - AmbientChanged event (DisplayAsDefault = *True*)
4 - Show event (DisplayAsDefault = True)
Any ideas to put my control working properly?
Thanks in advance,
Paulo Costa
-
Re: Default property problem
The default property does not determine which control gets the focus first.
If a control has tabindex of zero, it will get the focus. In the case of
command buttons, it will cause the command button to receive a click event
when the user pushes enter.
--
Michael Culley
www.vbdotcom.com
-
Re: Default property problem
That's true but I thought that it was because of the presence of my button
control. Simple stuff sometimes...
Anyway I could give this functionality to my button control through the
Extender Object, it holds the Default Property set at design time.
Paulo Costa
"Michael Culley" <mculley@optushome.com.au> wrote in message
news:3d3bb23b@10.1.10.29...
> The default property does not determine which control gets the focus
first.
> If a control has tabindex of zero, it will get the focus. In the case of
> command buttons, it will cause the command button to receive a click event
> when the user pushes enter.
>
> --
> Michael Culley
> www.vbdotcom.com
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks