Jump to content

Recommended Posts

Posted

Hello,

Sorry for this question but I am New in this.

I test last version on UniGui and I have a question:

I create one Form dynamically with some controls:

 Steps :

    Create Form - is TMdiChild on MainForm. BorderStyle= bsNone 

    Create TGroupBox.PArent = Form

    Create Panel.Parent = Form

    Create TGroupBox.Button1.Visible = True

    Create TGroupBox.Button2.Visible = False

    Form.Show

when I work on This way Button2 is visible but no OnClick fire.

 

I think Button2 is Visible=False but is Visible on Form.

 

Is this a BUG or I somewhere wrong

 

10x

Posted

Hi,

 

Welcome to our wonderful UniGUI Forum!

 

Can you try analyze the demo projects?!, including:

C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\Dynamic

Best regards.

Posted

Hi, tank you for this.

But my problem is still here.

I will explain:

Can I do this?

1. Create Form1

2. Create Button like this: TUniButton(InsertControl(TUniButton.Create(Self))) , Self=Form1

3. Create TUniPanel (InsertControl(TUniPanel.Create(Self)))

4. Set Panel.Name = 'TestPanel'

5. Set Button.Parent = TestPanel

 

I try to create "button" with parent "TestPanel" with parent "Form1", how can do this

Posted

For example,

try:

procedure bClick(Sender: TObject);

procedure TMainForm.bClick(Sender: TObject);
begin
  ShowMessage('Click');
end;

procedure TMainForm.UniButton1Click(Sender: TObject);
var
  C: TWinControl;
begin
  
  C := TUniPanel.Create(Self);

  with TUniPanel(InsertControl(C)) do
  begin
    Left:=70;
    Top:=48;
  end;

  with TUniButton(InsertControl(TUniButton.Create(Self))) do
  begin
    Parent := C;
    Left:=70;
    Top:=48;
    Font.Style:=[fsBold];
    Font.Color:=clGreen;
    Caption:='Click!';
    OnClick:=bClick;
  end;
end;
Posted

How You create a new form "Form1"

Form1 is mdiChild Form of mainForm (mdiForm), Testpanel is child of Form1, and button is child of Testpanel

after that Button.Visible = False.

 

I explain my idea.

I Have Desktop application. 

Create MasterForm as mdiForm, after that i dynamically create various forms as MDIChild of MasterForm.

On Screen (MasterForm) always is visible one mdiChild form, she can have diffеrent controls: Panels, button, labels and so on

some of this controls are Visible=False, other are Visible=True.

 

Now, i want to bild Web application like this idea.

I use Mainform as mdiForm (MasterForm), she have one button.OnClick - create new form mdiChild and all components on mdiChild Form.

 

When is use Your example all components go to the MasterForm, but I want to be in mdiChild Form.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...