And why reparent... The listview must be in a popup type window.. and then just move it at textbox screenx and .screeny Le 17 nov. 2014 22:31, "Jørn Erik Mørne" <[email protected]> a écrit :
> > Den 17. nov. 2014 21:36, skrev Charlie Reinl: > > Am Sonntag, den 16.11.2014, 17:57 +0000 schrieb Sam Dadds: > >> Hi All, > >> > >> Need help with a custom ComboBox. > >> > >> I've created a UserControl (extends UserControl) with the normal > stuff > >> (TextBox for selection, picture for selected item and picture for > dropdown button). > >> > >> The actual drop down list is a ListView instead of a ListBox for > item pictures. > >> This all works well. > >> > >> Problem is with positioning the drop down list. The ListView > actually gets re-parented > >> to the underlying form so it will display normally even when the > ComboBox is inside a > >> toolbar or other container. > >> > >> Finding the correct X and Y is a problem. Depending on how many > containers the actual > >> ComboBox is inside the X and Y become difficult to calculate. > >> > >> It seems the borders or margin padding of the additional containers > are not taken into consideration when reporting the X and Y of the ComboBox > container. > >> > >> Currently I've tried iterating up the containers via the parent of > the ComboBox and > >> add up the left or X properties until the actual parent form is found. > This is close > >> but not 100% accurate. By adding in the Desktop.Scale it gets a bit > closer but still > >> off. > >> > >> I've looked at the source for the db version of a ComboBox but the > internal ListBox > >> is actually used. > >> > >> Does anyone have an example of this or a better idea of how to use a > ListView as the > >> List container of the ComboBox? > >> > >> It's not critical but it would be nice to have item pictures in a > ListBox or ComboBox. > >> > >> Thanks. > > Salut Sam, > > > > have a look at Christof Thalhofer's "Gambas Combobox for Lists and > > Databases", https://github.com/Deganius/DegComboBox , may be you find > > some ideas. > > > Perhaps I haven't understood your issue, but why not set the > ListView.Ignore = True and the parent to the current form? > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/gambas-user > ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
