Stop default loadin...
 
Notifications
Clear all

Stop default loading of splash form in VB6  

  RSS

advinsql
(@advinsql)
New Member
Joined: 6 years ago
Posts: 4
25/05/2018 7:20 am  

Please help!!

In my program I have taken login form as splash form & my starting point of program is MDI form, but when I run the program MDI form loads along with splash form as default loading.

How can I load only MDI form without default loading of splash form

Thanks in advance


Quote
sels2005j
(@sels2005j)
New Member
Joined: 7 years ago
Posts: 4
25/05/2018 8:19 am  

Hi,

Your question is not clear.

Please share your code.

Thanks

 


ReplyQuote
advinsql
(@advinsql)
New Member
Joined: 6 years ago
Posts: 4
25/05/2018 8:32 am  

Thanks for replying

I have set startup object MDI form not splash screen but when i run the program both MDI & Splash screen loads together

Below is the code for MDI form in loading event

Private Sub MDIForm_Load()
Me.Top = (Screen.Height \ 2) - (Me.Height \ 2)
Me.Left = (Screen.Width \ 2) - (Me.Width \ 2)

If frmSplash.Visible = True Then
FRMMAIN.Vis.Enabled = False
FRMMAIN.Rep.Enabled = False
FRMMAIN.Master.Enabled = False
Else
FRMMAIN.Vis.Enabled = True
FRMMAIN.Rep.Enabled = True
FRMMAIN.Master.Enabled = True
End If
End Sub

Below is the code in splash screen which is my login form

Private Sub Form_Load()

Me.Top = (Screen.Height \ 2) - (Me.Height \ 2)
Me.Left = (Screen.Width \ 2) - (Me.Width \ 2)

OpenConnection
'Picture2.Visible = False

Set rs = New ADODB.Recordset
rs.Open "select * from user_master", cn, adOpenDynamic, adLockOptimistic
While Not rs.EOF
Combo1.AddItem rs("username")
rs.MoveNext
Wend
End Sub

Thanks & Regards


ReplyQuote
advinsql
(@advinsql)
New Member
Joined: 6 years ago
Posts: 4
25/05/2018 8:50 am  

Hi everyone!!!

M debugged my above coding & found that if I close the if block in MDI form then the result is only MDI form loading 

Hence Solved

Thanks


ReplyQuote
sels2005j
(@sels2005j)
New Member
Joined: 7 years ago
Posts: 4
25/05/2018 8:55 am  

Did you solve the issue ?


ReplyQuote
advinsql
(@advinsql)
New Member
Joined: 6 years ago
Posts: 4
25/05/2018 9:09 am  

Yes sir

I commented the below lines in (If Block) & now the result is what i want

Private Sub MDIForm_Load()
Me.Top = (Screen.Height \ 2) - (Me.Height \ 2)
Me.Left = (Screen.Width \ 2) - (Me.Width \ 2)

'If frmSplash.Visible = True Then
FRMMAIN.Vis.Enabled = False
FRMMAIN.Rep.Enabled = False
FRMMAIN.Master.Enabled = False
'Else
' FRMMAIN.Vis.Enabled = True
' FRMMAIN.Rep.Enabled = True
' FRMMAIN.Master.Enabled = True
'End If
End Sub

Any other suggestions are welcome

Thanks & Regards


ReplyQuote