Am 27.04.2016 10:12, schrieb adamn...@gmail.com: > On Wed, 27 Apr 2016 09:44:55 +0200 > Rolf-Werner Eilert <eilert-sprac...@t-online.de> wrote: > >> Does really nobody know why I cannot set the SelectedFont value as >> mentioned in the documentation? >> >> Rolf >> >> Am 26.04.2016 12:57, schrieb Rolf-Werner Eilert: >>> "Courrier" is French, in my list there is "Courier". I can choose it >>> from the list, but I cannot set the list to this value/index/string. >>> >>> Rolf >>> >>> Am 26.04.2016 12:39, schrieb Fabien Bodard: >>>> Courrier >>>> Le 26 avr. 2016 12:12, "Rolf-Werner Eilert" <eilert-sprac...@t-online.de> a >>>> écrit : >>>> >>>>> The docu reads: >>>>> >>>>> FontChooser.SelectedFont (gb.form) >>>>> >>>>> Property SelectedFont As String >>>>> >>>>> Returns or sets the selected font as a string. >>>>> >>>>> When I try to do >>>>> >>>>> Dim MyFont As String >>>>> >>>>> MyFont = "Courier" >>>>> fcMyFont.SelectedFont = MyFont >>>>> >>>>> nothing happens. >>>>> >>>>> Am I expecting too much? >>>>> >>>>> Rolf >>>>> > hmm > ' Gambas class file > > Public Sub _new() > > FontChooser1.SelectedFont = "Courier" > Print FontChooser1.SelectedFont > > End > seems to work ok here? > >
Ahh ok, this makes sense. It does run like this, but the dropdown list still doesn't reflect it. But I found the reason. I only needed the dropdown list visible, so I decreased the control to 29 px. This way, however, the preview area isn't visible, and the control seems to need the preview area to refresh the dropdown list. So my solution was FontChooser1.Height = 110 FontChooser1.SelectedFont = "Courier" FontChooser1.Height = 29 This way it runs like expected... :) Regards Rolf ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user