Click here to Skip to main content
15,917,795 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Reading Multiple text file from a folder and count specific words Pin
Richard MacCutchan22-Mar-18 8:52
mveRichard MacCutchan22-Mar-18 8:52 
QuestionRe: Reading Multiple text file from a folder and count specific words Pin
Member 1373342222-Mar-18 17:01
Member 1373342222-Mar-18 17:01 
AnswerRe: Reading Multiple text file from a folder and count specific words Pin
mo149222-Mar-18 20:09
mo149222-Mar-18 20:09 
AnswerRe: Reading Multiple text file from a folder and count specific words Pin
Richard MacCutchan22-Mar-18 23:13
mveRichard MacCutchan22-Mar-18 23:13 
GeneralRe: Reading Multiple text file from a folder and count specific words Pin
Eddy Vluggen23-Mar-18 2:18
professionalEddy Vluggen23-Mar-18 2:18 
GeneralRe: Reading Multiple text file from a folder and count specific words Pin
Richard MacCutchan23-Mar-18 2:33
mveRichard MacCutchan23-Mar-18 2:33 
GeneralRe: Reading Multiple text file from a folder and count specific words Pin
Eddy Vluggen23-Mar-18 2:36
professionalEddy Vluggen23-Mar-18 2:36 
PraiseRe: Reading Multiple text file from a folder and count specific words Pin
Richard MacCutchan23-Mar-18 2:42
mveRichard MacCutchan23-Mar-18 2:42 
GeneralRe: Reading Multiple text file from a folder and count specific words Pin
Eddy Vluggen23-Mar-18 2:44
professionalEddy Vluggen23-Mar-18 2:44 
QuestionQR CODE IN ARABIC Pin
Member 1054250021-Mar-18 4:45
Member 1054250021-Mar-18 4:45 
AnswerRe: QR CODE IN ARABIC Pin
Eddy Vluggen22-Mar-18 6:58
professionalEddy Vluggen22-Mar-18 6:58 
QuestionThe application does not close Pin
desanti20-Mar-18 13:13
desanti20-Mar-18 13:13 
AnswerRe: The application does not close Pin
Gerry Schmitz20-Mar-18 17:13
mveGerry Schmitz20-Mar-18 17:13 
GeneralRe: The application does not close Pin
desanti20-Mar-18 17:24
desanti20-Mar-18 17:24 
GeneralRe: The application does not close Pin
Gerry Schmitz20-Mar-18 20:15
mveGerry Schmitz20-Mar-18 20:15 
GeneralRe: The application does not close Pin
desanti21-Mar-18 7:19
desanti21-Mar-18 7:19 
AnswerRe: The application does not close Pin
Ralf Meier20-Mar-18 23:42
mveRalf Meier20-Mar-18 23:42 
AnswerRe: The application does not close Pin
mo149221-Mar-18 2:58
mo149221-Mar-18 2:58 
GeneralRe: The application does not close Pin
desanti21-Mar-18 9:51
desanti21-Mar-18 9:51 
GeneralRe: The application does not close Pin
mo149221-Mar-18 11:31
mo149221-Mar-18 11:31 
I don't know how complicated your implementation is.

As a test I've done this.
Created Form1 and Form2

On Form1 Load I did this:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim splash As New Form2
If splash.ShowDialog() = Windows.Forms.DialogResult.Cancel Then
Application.Exit()
End If

End Sub

In Form2 I just implemented a button:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DialogResult = Windows.Forms.DialogResult.Cancel
End Sub


When the application runs and Form1 loads, Form2 is displayed from the load procedure.
Clicking the button causes Form2 to close gracefully with (DialogResult = Cancel) and return Cancel in this example and the application does not open.
Returning OK allows the app to open.

Also I tried this instead of Load() and it works also:

Private Sub Form1_Shown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
Dim dlg As New Form2
If dlg.ShowDialog() = Windows.Forms.DialogResult.Cancel Then
Application.Exit()
End If

End Sub

It should be this simple. If this does not help I can only suggest that you make sure you don't
do any initialization of data or processes prior to verifying user through the splash screen.
That is, don't initialize anything in Load() if you are showing the splash screen in Shown().

Hope this helps.

-- modified 21-Mar-18 17:50pm.
GeneralRe: The application does not close Pin
Eddy Vluggen22-Mar-18 7:00
professionalEddy Vluggen22-Mar-18 7:00 
Questionprinting data to report in crystal report Pin
Kim Gabinete18-Mar-18 7:03
Kim Gabinete18-Mar-18 7:03 
SuggestionRe: printing data to report in crystal report Pin
Richard MacCutchan18-Mar-18 7:40
mveRichard MacCutchan18-Mar-18 7:40 
GeneralRe: printing data to report in crystal report Pin
Mycroft Holmes18-Mar-18 12:57
professionalMycroft Holmes18-Mar-18 12:57 
QuestionRe: printing data to report in crystal report Pin
Eddy Vluggen18-Mar-18 9:09
professionalEddy Vluggen18-Mar-18 9:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.