1 (edited by thezimguy 2018-12-07 19:06:59)

Topic: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

Hello Dmitry, Derek and MVD Users,
Please is there an example project on a way to create mdi child forms?

I saw in the functions and class panel TFormstyle:(fsMDIChild,
How do I use it to achieve the MDI Child Form




link to SALES & INVENTORY SYSTEM
http://myvisualdatabase.com/forum/viewt … 949#p27949
Regards

@thezimguy

2 (edited by thezimguy 2018-09-14 09:53:42)

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

I have been able to solve it myself using the below code.

procedure Form1_btnF2_OnClick(Sender:TObject; var Cancel:Boolean);
begin
     Form2.FormStyle:=fsMDIChild;
end;
begin
     Fom1.windowState:=wsMaximized;// or set in the properties
     Form1.FormStyle:=fsMDIForm;
end.
@thezimguy

3 (edited by thezimguy 2018-09-15 12:56:32)

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

PROBLEM NO.1
The problem I'm facing now is.....
1. When there are components on Form1(MDIForm) and you open the Form2(MDIChild)...
The Form2(MDIChild) goes behind the components on Form1(MDIForm).
2. Also if I try to close a MDIChild Form it minimizes instead of closing the MDIChild form
Any fix?
Regards

@thezimguy

4 (edited by thezimguy 2018-09-14 09:54:16)

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

PROBLEM NO.2


procedure Form1_btnF2_OnClick(Sender:TObject; var Cancel:Boolean);
begin
     Form2.FormStyle:=fsMDIChild;
end;

procedure Form1_btnF3_OnClick(Sender:TObject; var Cancel:Boolean);
begin
     Form3.FormStyle:=fsMDIChild;
end;
begin
     Form1.windowState:=wsMaximized;// or set in the properties
     Form1.FormStyle:=fsMDIForm;
end.

Issue:
1. Run program
2. Click on button (btnF2) to show MDIChild Form(Form2)
3. Click on button (btnF3) to show MDIChild Form(Form3)
4. Click on button (btnF2) again

After clicking on the last button, I was expecting the MDIChild Form(Form2) to get focused but MDIChild Form(Form3) is still on top

Any fix?
Regards

@thezimguy

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

Download example project

Post's attachments

Attachment icon MDIForm.zip 333.3 kb, 236 downloads since 2018-09-14 

@thezimguy

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

Also, how do I prevent my application from showing multiple open windows in the task bar

@thezimguy

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

Thank you thezimguy for the example project.
I wish to get answers for the subsequent questions
Thanks

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

thezimguy wrote:

PROBLEM NO.1
The problem I'm facing now is.....
1. When there are components on Form1(MDIForm) and you open the Form2(MDIChild)...
The Form2(MDIChild) goes behind the components on Form1(MDIForm).

You can't change it. It should be.


thezimguy wrote:

2. Also if I try to close a MDIChild Form it minimizes instead of closing the MDIChild form
Any fix?
Regards

It's standard behavior for child forms, but you can change it

procedure Form2_OnClose (Sender: TObject; Action: string);
begin
    Form2.FormStyle:=fsNormal;
end;

// how to open again
procedure btnF2_OnClick(Sender: TObject; var Cancel: boolean);
begin
    Form2.FormStyle:=fsMDIChild;
    Form2.Show;
    Form2.WindowState := wsNormal;
end;
Dmitry.

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

thezimguy wrote:

PROBLEM NO.2


Issue:
1. Run program
2. Click on button (btnF2) to show MDIChild Form(Form2)
3. Click on button (btnF3) to show MDIChild Form(Form3)
4. Click on button (btnF2) again

After clicking on the last button, I was expecting the MDIChild Form(Form2) to get focused but MDIChild Form(Form3) is still on top

Any fix?
Regards

Please download latest beta version:
https://www.dropbox.com/s/yagi074bd24ox … a.zip?dl=0



I added method BringToFront for form

procedure btnF2_OnClick(Sender: TObject; var Cancel: boolean);
begin
    Form2.FormStyle:=fsMDIChild;
    Form2.BringToFront;

end;

procedure btnF3_OnClick(Sender: TObject; var Cancel: boolean);
begin
    Form3.FormStyle:=fsMDIChild;
    Form3.BringToFront;
end;
Dmitry.

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

thezimguy wrote:

Also, how do I prevent my application from showing multiple open windows in the task bar

Unfortunately I don't know how to change it.

Dmitry.

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

This is great. Good to know that it's possible to make those changes.
I really appreciate your kind gesture Dmitry.

@thezimguy

12 (edited by thezimguy 2018-09-21 14:59:10)

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

Hello Dmitry, Derek and MVD users,
Possible bug during design form
https://i.postimg.cc/43CSP4w3/form.png

During the design of the form
1. I enlarged the form height and width so I was scrolling during the design
2. I decreased the height and width of the form but parts of the form( top and left) is no more visible for editing
See attached image
Thank you in advance

@thezimguy

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

Thank you for the bug report, I know about this bug.

Dmitry.

14 (edited by thezimguy 2018-09-21 15:32:01)

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

Again Dmitry,
Please will it be possible to have multiple tabs for the script for easy working in the code?

Example
If I have two forms (Form1 & Form2)
I want to create two script tabs,  one for Form1 and the other for Form2
There can also be a general script tab
Apparently, I have been using the key word 'uses' to include individual scripts into the project and do the coding in vscode Editor.
I think it will be very handy if we can code the in MVD.
Thank you

@thezimguy

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

Yes, it's nice idea, I have already think about it, I believe that I will implement it in the future.

Dmitry.

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

@theZimGuy -  Is this a Point Of Sale project you're working on?  From your screenshot I took a look and at a
glance it appears to be.  Please let me know because I'm interested on developing one using MVD.

Cheers!

17 (edited by thezimguy 2018-12-07 12:36:36)

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

gonpublic2k wrote:

@theZimGuy -  Is this a Point Of Sale project you're working on?  From your screenshot I took a look and at a
glance it appears to be.  Please let me know because I'm interested on developing one using MVD.

Cheers!

Please find attached.
To use this project, pls dont forget to create a mySQL database first.
You can install xampp and access it phpMyAdmin to do that.
Import the zims.sql after you create the database.
Provide the database settings when prompted.
Example

Server(Host) : localhost
Port : 3306
User : root (default)
Password : (empty default)
Database : zims (the name of the database you created)

Sorry for the delay

Post's attachments

Attachment icon POS.zip 934.42 kb, 209 downloads since 2018-12-05 

@thezimguy

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

Thank you theZimGuy,
It really suits my need
Very handy
I wish you will continue building it and update us if possible. We shall also share our opinions to facilitate it's implementations.

19 (edited by rodmontgt 2018-12-07 16:18:30)

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

thezimguy wrote:
gonpublic2k wrote:

@theZimGuy -  Is this a Point Of Sale project you're working on?  From your screenshot I took a look and at a
glance it appears to be.  Please let me know because I'm interested on developing one using MVD.

Cheers!

Please find attached.
To use this project, pls dont forget to create a mySQL database first.
You can install xampp and access it phpMyAdmin to do that.
Import the zims.sql after you create the database.
Provide the database settings when prompted.
Example

Server(Host) : localhost
Port : 3306
User : root (default)
Password : (empty default)
Database : zims (the name of the database you created)

Sorry for the delay

Trying to run your project in MVD 5.0 but it throw an error, see the attachment please

Post's attachments

Attachment icon Captura.JPG 309.81 kb, 39 downloads since 2018-12-07 

20 (edited by ekuaeshun13 2018-12-07 18:00:59)

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

rodmontgt wrote:
thezimguy wrote:
gonpublic2k wrote:

@theZimGuy -  Is this a Point Of Sale project you're working on?  From your screenshot I took a look and at a
glance it appears to be.  Please let me know because I'm interested on developing one using MVD.

Cheers!

Please find attached.
To use this project, pls dont forget to create a mySQL database first.
You can install xampp and access it phpMyAdmin to do that.
Import the zims.sql after you create the database.
Provide the database settings when prompted.
Example

Server(Host) : localhost
Port : 3306
User : root (default)
Password : (empty default)
Database : zims (the name of the database you created)

Sorry for the delay

Trying to run your project in MVD 5.0 but it throw an error, see the attachment please

https://i.postimg.cc/43CSP4w3/form.png
You have to set frmDashboard as the default form.
I can see that you have changed it from being default.
Just make it default and it will work.
It worked for me

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

ekuaeshun13 wrote:
rodmontgt wrote:
thezimguy wrote:

Please find attached.
To use this project, pls dont forget to create a mySQL database first.
You can install xampp and access it phpMyAdmin to do that.
Import the zims.sql after you create the database.
Provide the database settings when prompted.
Example

Server(Host) : localhost
Port : 3306
User : root (default)
Password : (empty default)
Database : zims (the name of the database you created)

Sorry for the delay

Trying to run your project in MVD 5.0 but it throw an error, see the attachment please

You have to set frmDashboard as the default form.
I can see that you have changed it from being default.
Just make it default and it will work.
It worked for me

I finally got Apache to run fine and MySQL and I ran your project and it worked perfectly for me.  Now time to study it well and improve it!

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

gonpublic2k wrote:
ekuaeshun13 wrote:
rodmontgt wrote:

Trying to run your project in MVD 5.0 but it throw an error, see the attachment please

You have to set frmDashboard as the default form.
I can see that you have changed it from being default.
Just make it default and it will work.
It worked for me

I finally got Apache to run fine and MySQL and I ran your project and it worked perfectly for me.  Now time to study it well and improve it!

@gonpublic2k
Any improvement on the POS project?
Let us know if you have been able to do a major update on the project. Share with us.
Regards

@thezimguy

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

thezimguy wrote:
gonpublic2k wrote:
ekuaeshun13 wrote:

You have to set frmDashboard as the default form.
I can see that you have changed it from being default.
Just make it default and it will work.
It worked for me

I finally got Apache to run fine and MySQL and I ran your project and it worked perfectly for me.  Now time to study it well and improve it!

@gonpublic2k
Any improvement on the POS project?
Let us know if you have been able to do a major update on the project. Share with us.
Regards

Hi!  to be honest I haven't really done much since the last time that we wrote about this, I have been very busy at work and stuff
and haven't been able to take the time to develop.  As soon as I retake the project I'll post my results and keep in touch.  Thanks for the follow-up!

Re: [SOLVED]SALES & INVENTORY SYSTEM + MDI & MDIChild Forms

Okay

@thezimguy