-
Feb 7th, 2025, 05:44 PM
#1
Thread Starter
Hyperactive Member
Modal Form
I want to set parameters on a form then show modal.
Set fForm = frmMine
Load fForm
fForm.AParam = "123"
fForm.Show me, vbModal ' cannot because form already loaded.
Is there an API way ?
This is for an embedded PC anf the form being shown must be visible and nothing else can sit on top.
Controls on this form can close it.
-
Feb 8th, 2025, 02:52 AM
#2
Re: Modal Form
Remove the line with the load statement
-
Feb 8th, 2025, 10:35 AM
#3
Re: Modal Form
 Originally Posted by LorinM
I want to set parameters on a form then show modal.
Set fForm = frmMine
Load fForm
fForm.AParam = "123"
fForm.Show me, vbModal ' cannot because form already loaded.
Is there an API way ?
This is for an embedded PC anf the form being shown must be visible and nothing else can sit on top.
Controls on this form can close it.
LorinM,
I just see two problems:
1) You never instantiated your form: Set fForm = New frmMine
2) You reversed the arguments to show it. It should be: fForm.Show vbModal, me
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Feb 13th, 2025, 01:04 PM
#4
Thread Starter
Hyperactive Member
Re: Modal Form
1) yes I do but did not show.
2) my bad. a dyslectic typo.
Is there no API that will make the form Modal after all has settled down ?
-
Feb 13th, 2025, 01:08 PM
#5
Re: Modal Form
I use the following often:
Code:
Dim fTest As frmTest
Set fTest = new frmTest
fTest.PropertyA = “Test”
fTest.Show vbModal
-
Feb 13th, 2025, 01:30 PM
#6
New Member
Re: Modal Form
i Use
in FormParent (pForm)
Code:
Private Sub Command_click()
Label1.tag = "123" 'Something with TAG
cForm.Show [1]
End Sub
in FormChild (cForm)
Code:
Private Sub Form_Load()
Dim Value as String
Value = pForm.Label1.tag
pform.label.tag = ""
End sub
-
Feb 17th, 2025, 02:09 PM
#7
Hyperactive Member
Re: Modal Form
 Originally Posted by LorinM
I want to set parameters on a form then show modal.
Set fForm = frmMine
Load fForm
fForm.AParam = "123"
fForm.Show me, vbModal ' cannot because form already loaded.
Is there an API way ?
This is for an embedded PC anf the form being shown must be visible and nothing else can sit on top.
Controls on this form can close it.
I got 2 ways.
Code:
Set fForm = frmMine
fForm.AParam = "123"
fForm.Show me, vbModal
Code:
Set fForm = frmMine
Load fForm
fForm.Show me, vbModal
fForm.AParam = "123"
MicrosoftWindowsxp
Professional
was the peak Windows version not gonna lie
-
Feb 18th, 2025, 01:27 AM
#8
Member
Re: Modal Form
What I do in this case :
Form1 :
Code:
Option Explicit
Private Sub Command1_Click()
Form2.Parameter = "Essai"
Form2.Show vbModal, Me
End Sub
Form2 :
Code:
Option Explicit
Private frmParameter As String
Private Sub Form_Load()
Debug.Print frmParameter
End Sub
Public Property Get Parameter() As String
Parameter = frmParameter
End Property
Public Property Let Parameter(ByVal sValue As String)
frmParameter = sValue
End Property
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|