You are not logged in.

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

1

Tuesday, September 25th 2012, 6:47am

msgbox before close form

Hi again could you please help me how can i have a msgbox ask before close form (when pressed "X")
I was trying something like this

Private Sub Form_Unload(Cancel As Integer)

If MsgBox("Are you sure you want to quit?", vbYesNo + vbQuestion, "Unload Test") = vbYes Then

Call End

End If

End Sub


but nothing happened

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

2

Tuesday, September 25th 2012, 10:20am

Hey there,

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'in Module1...
Public Sub main(ByJava args() As String)
   Dim myArgs() As String
   myArgs = args
   Form1.SetDefaultClose()
   
   Form1.Parent.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)

   Form1.Show()
End Sub


'in your Form...
Public Sub Form_Unload(cancel As Integer)
   If MsgBox ("Quit?", vbCritical Or vbOKCancel,"Title") = 2 Then Exit Sub
   Me.Parent.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)
End Sub


have fun...

Dani

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

3

Tuesday, September 25th 2012, 1:44pm

Hi Dani, thank again for you help.
It is very good that there are people like you that help all of us that we are at our first steps.
I tried your solution but nothing happened.
Have you got any idea what am i doing wrong?

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

4

Tuesday, September 25th 2012, 2:27pm

Hey there,

did you update your framework version like I mentioned here:

http://www.jabaco.org/board/p3242-combob…1.html#post3242

Thats about all I can think of.

Try the testproject though...Test1.zip


Dani

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

5

Wednesday, September 26th 2012, 7:25am

i tried your example but when i press "x" nothing happening.


my last framework is Jabaco200910070500.jar
because as i heard it is better to have size bigger that 500 kb

This post has been edited 1 times, last edit by "fomaxrge" (Sep 26th 2012, 7:37am)


Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

6

Wednesday, September 26th 2012, 8:02am

Hey there,

well you are right...
With that framework version you will not be able to run my code!

Dani

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

7

Wednesday, September 26th 2012, 9:21am

which framework do you suggest after this one to upload?
So to work your code

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

8

Wednesday, September 26th 2012, 10:29am

Hey there,

I already gave you the link yesterday...

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

9

Thursday, September 27th 2012, 10:52am

You mean to add this one ?
http://www.jabaco.org/board/p3044-comman…r.html#post3044.
Is there a possibility to have problem with my version after ADD?
Missing classes and other?

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

10

Thursday, September 27th 2012, 1:04pm

Hey there,

this is realy not very complicated:

- download Jabaco-rev87.jar (thanks to theuserbl!)
- In your Jabaco installation path rename Jabaco.jar to Jabaco.old in case you need to switch back. And paste in Jabaco-rev87.jar renaming it to Jabaco.jar. Start up Jabaco voila. You are all set!

If you don't like it simply switch back to your old version!

Dani

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

11

Thursday, September 27th 2012, 4:37pm

Dear Dani i did it and it works BUT i have too many missing classes what should i do with them?

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

12

Thursday, September 27th 2012, 6:18pm

Hey there,

are you realy lacking any functionality / classes you need?
Or are there missing classes stated in your 'imports' window that you don't know what to do with?
If that is the case simply hit the 'clean' button...

I am not missing any classes using this framework version.
Everything seems to be in place and working just fine for me!!

So I don't know how to help you here!? Sorry...


Dani

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

13

Friday, September 28th 2012, 11:28am

Dani i can see my missing classes with red color when i press F1.
What do you propose to do with them?
to hit the 'clean' button

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

14

Wednesday, January 9th 2013, 12:05pm

Hi again and happy new year!
I need your help please..

I use this code to make a msgbox ask me if i want to quit.

Jabaco Source

1
2
3
4
5
'in my Form...
Public Sub Form_Unload(cancel As Integer)
   If MsgBox ("Quit?", vbCritical Or vbOKCancel,"Title") = 2 Then Exit Sub
   Me.Parent.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)
End Sub


and

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
Public Form1 As New laoding_form

'in Module1...
Public Sub main(ByJava args() As String)
   Dim myArgs() As String
   myArgs = args
   Form1.SetDefaultClose()
   
   Form1.Parent.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)

   Form1.Show()
End Sub


now i have another form called "main_form".
So first runs loading_from (that has a progress bar) and then close and oped main_from

if i use the above code it does not work on me and when i change the code to....



Jabaco Source

1
2
3
4
5
6
7
8
9
'in my Form...

Public Sub Form_Unload(cancel As Integer)

   If MsgBox ("Quit?", vbCritical Or vbOKCancel,"Title") = 2 Then Exit Sub

   Me.Parent.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)

End Sub


and



Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Public Form1 As New main_form



'in Module1...

Public Sub main(ByJava args() As String)

   Dim myArgs() As String

   myArgs = args

   Form1.SetDefaultClose()

   

   Form1.Parent.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)



   Form1.Show()

End Sub




it works but i can not see my loadind_from (opens only main_form)

thanks in advanced!

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

15

Wednesday, January 9th 2013, 4:07pm

Does this help?


loading_form:

Jabaco Source

1
2
3
4
Public Sub Form_Unload(cancel As Integer)
   Form1.Visible = True
   Form1.Show
End Sub


main_form:

Jabaco Source

1
2
3
4
Public Sub Form_Unload(cancel As Integer)
   If MsgBox ("Quit?", vbCritical Or vbOKCancel,"Title") = 2 Then Exit Sub
   Me.Parent.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)
End Sub


Module1:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Public Form1 As New main_form
Public Form2 As New loading_form

'in Module1...
Public Sub main(ByJava args() As String)
   Dim myArgs() As String
   myArgs = args
   
   Form1.Visible = False
   Form1.SetDefaultClose()
   Form2.Show
   
   Form1.Parent.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)

End Sub



Greatings
theuserbl

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

16

Wednesday, January 9th 2013, 10:11pm

because i have another one form could you please help me how to do it because it seams a little bit complicated to me?

I have a loading_form (that has progress bar) and when it comes 100% close (auto) and open...
login_form that asks for username and password (if you put the right codes) then close and open...
main_form that is the form that i have all my code.
THAT IS THE FORM I WANT TO ASK BEFORE CLOSE.

Theera

Beginner

  • "Theera" is male

Posts: 21

Date of registration: Feb 27th 2014

Location: Supanburi ,Thailand

Occupation: Agric Chemical Seller

Hobbies: learning programming and English

  • Send private message

17

Sunday, March 2nd 2014, 4:49am

Hi all,
I need the form to ask when I click the x button which the right-top conner of the windows. How to code in Sub Form_Unload or Module1?
Other cases,I can do.
Theera has attached the following file:
P.S. I'm not good at English and programming,Please understand me.
Best Regards,

Theera

This post has been edited 3 times, last edit by "Theera" (Mar 2nd 2014, 7:41am)


jbExplorer

Trainee

Posts: 111

Date of registration: Mar 18th 2013

  • Send private message

18

Sunday, March 2nd 2014, 1:00pm

Hi all,
I need the form to ask when I click the x button which the right-top conner of the windows. How to code in Sub Form_Unload or Module1?
Other cases,I can do.
Theera, use Dani's sample. Start there, that produces the effect that you want. Then add your command buttons and functionality.

http://www.jabaco.org/board/index.php?pa…ttachmentID=308

Theera

Beginner

  • "Theera" is male

Posts: 21

Date of registration: Feb 27th 2014

Location: Supanburi ,Thailand

Occupation: Agric Chemical Seller

Hobbies: learning programming and English

  • Send private message

19

Monday, March 3rd 2014, 2:32am

It works perfectly. Thank you ,jbExplorer
P.S. I'm not good at English and programming,Please understand me.
Best Regards,

Theera

Rate this thread
WoltLab Burning Board