ComboBox.PreventDropDown - Control items are free with the TAB key.

Author Message
 Posted 9/4/2014 10:08:26 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/29/2020 12:43:39 AM
Posts: 210, Visits: 642
cbIdUnidade.PreventDropDown = true;

However, when the user navigates through the fields with the TAB key, the control items are free to choose with arrows up and down.

Rogério Mauri
(www.licitec.com.br - Brazil)
Post #32661
Add to Twitter Add to Facebook
 Posted 9/4/2014 10:42:48 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 2 days ago @ 10:51:31 PM
Posts: 1,920, Visits: 21,126
Hi Rogerio.

That seems to make sense to me, since the property is saying that it will prevent the combo from dropping down its list, but not that you won't be able to navigate through its items using the arrow keys.
Post #32662
Add to Twitter Add to Facebook
 Posted 9/4/2014 1:52:40 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/29/2020 12:43:39 AM
Posts: 210, Visits: 642
Hi Ivan...

But in help documentation StrataFrame:

--------------

What's New In Version 1.6.5.

PreventDropDown property on a combo box has been added [440]

A new property has been to the combo box that will prevent the end-user from dropping down the list. This can be a useful tool when access to the drop down may need to be restricted for a period of time (modifying a record, for example).

--------------

Do not allow the user to change the record. This is expected. 

Rogério Mauri
(www.licitec.com.br - Brazil)
Post #32663
Add to Twitter Add to Facebook
 Posted 9/4/2014 11:19:05 PM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 2 days ago @ 10:51:31 PM
Posts: 1,920, Visits: 21,126
Would it work if you set its Enable property to False?
Post #32664
Add to Twitter Add to Facebook
 Posted 9/5/2014 12:18:32 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/29/2020 12:43:39 AM
Posts: 210, Visits: 642
When we use this property there are other problems. 





Post #32665
Add to Twitter Add to Facebook
 Posted 9/5/2014 10:00:04 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 2 days ago @ 10:51:31 PM
Posts: 1,920, Visits: 21,126
Not sure what might be going on there. Maybe I could try and reproduce it from my side, but for a start, I can tell you that I have lots of ComboBoxes which Enable properties are being set to False and it's been working just fine.

Also, reading the posts you mentioned, I noticed that in the end you state that you couldn't reproduce it on a test project and that you would investigate more in details what could be happening. Since you didn't come back with more information, I bet Trent assumed you had found something on your code.
Post #32666
Add to Twitter Add to Facebook
 Posted 9/21/2014 3:51:16 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/29/2020 12:43:39 AM
Posts: 210, Visits: 642
This is the componente code:

       ''' <summary>
        ''' Override to prevent logic from executing under certain circumstnaces
        ''' </summary>
        ''' <param name="m"></param>
        ''' <remarks></remarks>
        Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
            '-- Determine if the drop down should be prevented
            If _PreventDropDown Then
                '-- WM_LBUTTONDOWN or WM_LBUTTONDBLCLK 
                If m.Msg = &H201 OrElse m.Msg = &H203 Then Return
            End If

            MyBase.WndProc(m)
        End Sub

My suggestion:

       ''' <summary>
        ''' Override to prevent logic from executing under certain circumstnaces
        ''' </summary>
        ''' <param name="m"></param>
        ''' <remarks></remarks>
        Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
            '-- Determine if the drop down should be prevented
            If _PreventDropDown Then
                '-- WM_LBUTTONDOWN or WM_LBUTTONDBLCLK or WM_KEYDOWN
                If m.Msg = &H201 OrElse m.Msg = &H203 OrElse m.Msg = &H100 Then Return
            End If

            MyBase.WndProc(m)
        End Sub 

Rogério Mauri
(www.licitec.com.br - Brazil)

Tags:
Post #32694
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.