TMSFNCPopup VCL

Hello,

when I use xxx.PopupModal with a TMSFNCPopup, the popup is first create and shown in a corner of my main form and just after quickly moved at the good place (PlacementControl and Placement).
It is not very "beaufitul"
Is it possible to show it already at the good place ?
Thank you for your answer
Alexandre

Hi,

We couldn't see an issue here, please provide a full code snippet so we can investigate what is going on.

It probably comes from how I create the component to "popup" (a TComboBox). I didn't find any example of use of TMSFNCPopup in the examples you give.

cbb := TComboBox.Create(self.Owner);
cbb.Parent := FFormParent;
cbb.Style := csDropDownList;
cbb.Width := 250;
cbb.Items.AddStrings(listeIntitules);
cbb.ItemIndex := cbb.Items.IndexOf(FPlanningActif.intitule);
cbb.OnClick := callbackPlanningChoisi;
// On fabrique l'objet Popup de TMS
if Assigned(FTMSPopup) then
FTMSPopup.Free;
FTMSPopup := TTMSFNCPopup.Create(self.Owner);
FTMSPopup.ContentControl := cbb;
FTMSPopup.PlacementControl := FBarreOutils.Buttons[FIndiceBoutonChoisirPlanningHebdomadaire];
FTMSPopup.Placement := ppBottomCenter;
FTMSPopup.PopupModal;

"self" is a TTMSFNCPlanner
FBarreOutils is a TToolbar

Alexandre

Try commenting the cbb.Parent := FFormParent, or set the parent to nil, before showing the modal.

A beautiful exception because TComboBox doesn't have any parent ...
I'm going to do it by myself, without using TMSFNCPopup. For a single TComboBox, TMSFNCPopup is not absolutly necessary ... It was just a good occasion to discover it and use it. Later :)
Thank you for your answer
Alexandre

combobox needs a parent to add the items, but after that, the parent can be set to nil, perhaps that will eliminate the flickering, then again, perhaps the flickering will still happen because TComboBox needs a parent :slight_smile: Toggling the visible property might help as well.

Of course ... use the .visible property !! How it is possible that I did not think about that !!? It works now.
Your are a genius :slight_smile:

Thanks! :slight_smile: