You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

birosys

Trainee

  • "birosys" is male
  • "birosys" started this thread

Posts: 48

Date of registration: Feb 9th 2009

Location: Mladenovac, Serbia

Occupation: Programming

Hobbies: Programming

  • Send private message

1

Monday, October 4th 2010, 6:07pm

load multiple dialogs

Hello to all!

How to load and show dialogs from mainform?

I have one form and two dialogs. My code in module is

Jabaco Source

1
2
3
Public frm1 as Form1
Public dlg1 as dialog1
Public dlg2 as dialog2


and in Form1 is

Jabaco Source

1
2
3
dlg1=new dialog1
dlg2=new dialog2
dlg2.show


but, it don't working. Any suggestion?

And again, sorry for my english.

Milan

OlimilO

Intermediate

  • "OlimilO" is male

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

2

Tuesday, October 5th 2010, 12:18am

Hi Biro,

question, when do you call this code in Form? you only should do this in an eventhandler or method.

the following should work if you have two buttons on the form:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
Public Sub Command1_Click()
   If dlg1 = Nothing Then 
      dlg1 = New Dialog1
   End If
   dlg1.Show   
End Sub
Public Sub Command2_Click()
   If dlg2 = Nothing Then 
      dlg2 = New Dialog2
   End If
   dlg2.Show
End Sub


but beware! If you do it this way, the dialog will only be initialised once. this could lead to problems.



regards

OlimilO

birosys

Trainee

  • "birosys" is male
  • "birosys" started this thread

Posts: 48

Date of registration: Feb 9th 2009

Location: Mladenovac, Serbia

Occupation: Programming

Hobbies: Programming

  • Send private message

3

Wednesday, October 6th 2010, 8:15am

Hi OlimilO,

Thank you for response.

But, when i do that, only first dialog is loaded in memory, and they are not shown on screen!?!

I am totally confused.

What you think?

Milan

birosys

Trainee

  • "birosys" is male
  • "birosys" started this thread

Posts: 48

Date of registration: Feb 9th 2009

Location: Mladenovac, Serbia

Occupation: Programming

Hobbies: Programming

  • Send private message

4

Wednesday, October 6th 2010, 8:30am

Problem solved.

Dialogs must be declared in Form's General Declaration, dialogs, in my case are a child's of main form.

Thanks, again

Milan

Rate this thread
WoltLab Burning Board