[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

Custom control Dropdown

I've developed a custom control dropdown.
When entering data it must bring up a list of all the suggested options.

It seems easy, but if I add a listbox to my control that I hide and show when the user enter text it is working except when the combobox is at the bottom of a dialog form.

I have then tried to make the dropdown list part an additional form that would show when data is entered, but because my dialog form is shown modal, I also need to show this dropdown list form modal, and then I cannot enter text in the textbox anymore.

Don't know if this make sense?

0
koossa
Asked:
koossa
  • 3
  • 2
2 Solutions
 
HooKooDooKuCommented:
The  "Windows" solution to displaying a drop down list when the main combobox is too close to the bottom of the window is to have the drop down list appear ABOVE the combobox.
0
 
koossaAuthor Commented:
To give you and idea of what my problem is:

This is a std Microsoft dropdown
STD Combo

This is my custom control dropdown
Custom Combo

0
 
HooKooDooKuCommented:
Based on the zone you've placed this question, I'm assuming you're programming in VB6.  But your sample does NOT look like a VB6 application.  What exactly are you using to build this custom control as well as what are you using to build the application?

The thing that is making the Microsoft drop down behave as it does is because I believe the drop-down list is created with a window that has a style of "popup".  If you were programming in C++, you could build a popup style window yourself on the fly to accomplish what you want to do.

But if you are using a simple list control to simulate your drop down, the list control isn't a popup style window.  As such, the parent window clips the child window where it exceeds the limits of the parent window.

By contrast, a real Combo box has a drop down list that IS a popup window and behaves like you want.

As an example, I create a VB User Control that consisted of a Combo box and a List box that were populated by 5 lines of text on startup.  The controls were placed on a form such that the list box and drop down list would exceed the limits of the form.  As you can see, the Windows Combo within my User Control behaves just like you want, while the list box works just like you don't want.

And if you are programming in VB, I can't find any options that allow you to declare a window or child window or child control to be of style popup.  If you were programming in C++, or wanted to spend the time to dig into the windows API, you could build the window on the fly with a style of popup, but I can't find a way to do it in VB other than using existing controls that include popup windows.
Untitled.png
0
 
koossaAuthor Commented:
Hi

Yes, everything is developed in VB6
0
 
koossaAuthor Commented:
Thank you
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now