Hello Preethi,
Now in OnComplete slot of PresentDialog() if i post the autoResize() i.e. postsignal autoResize is triggered from there, then this issue gets resolved. Is this the right way to do?
Not really. Especially if you specify animations to perform during PresentDialog(), it will not work. From your latest description I have understood that you have modified the autoResize method to arrange the menu in a particular manner (to override the default positioning imposed by PresentDialog()). This seems to fail even with the new version of Menu templates.
Can you provide the implementation of such autoResize method for analysis purpose?
Per default dialogs are always centered. See also About positioning of Dialogs. As explained in the referred documentation, if you intend to arrange the menus (or generally any other dialog) in a particular way (e.g. top aligned), the best would be to prepare a transition object configured accordingly to align the dialogs in the desired manner. For example, if you want the menu to appear/disappear instantly (without fading animations), then:
Step 1: You create a new Show/Hide Transition object.
Step 2: Configure the object how to arrange the Dialog within its owner. In this way you specify alignment rules.
Step 3: Use the transition object when invoking PresentDialog() method. For this purpose you pass the transition object in the second parameter of PresentDialog() invocation (see also Perform Dialog transitions with animations):
PresentDialog( theMenuToPresent, YourUnit::TransitionObject, null, null, null,
null, null, null, null, false );
PresentDialog() uses the transition object to calculate the position for the menu to present. This is also true if you decide to present the menu with some animation. In such case you create the transition object by using the adequate template. See also Customize provided Dialog transition animations.
Best regards
Paul Banach