Click here to Skip to main content
16,005,552 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Conection Pooling Pin
Dave Kreskowiak17-Jul-06 1:50
mveDave Kreskowiak17-Jul-06 1:50 
Questionrichtextboxes and .doc files Pin
giddy_guitarist17-Jul-06 0:26
giddy_guitarist17-Jul-06 0:26 
AnswerRe: richtextboxes and .doc files Pin
Dave Kreskowiak17-Jul-06 4:39
mveDave Kreskowiak17-Jul-06 4:39 
QuestionRe: richtextboxes and .doc files Pin
giddy_guitarist17-Jul-06 9:37
giddy_guitarist17-Jul-06 9:37 
AnswerRe: richtextboxes and .doc files Pin
Dave Kreskowiak17-Jul-06 12:15
mveDave Kreskowiak17-Jul-06 12:15 
QuestionSave Changes Pin
slSoftware17-Jul-06 0:18
slSoftware17-Jul-06 0:18 
AnswerRe: Save Changes Pin
giddy_guitarist17-Jul-06 0:38
giddy_guitarist17-Jul-06 0:38 
GeneralRe: Save Changes Pin
slSoftware17-Jul-06 0:59
slSoftware17-Jul-06 0:59 
Thank u for helping.
But i have created the module module coding as follow

<br />
Module T_Module<br />
    Public Function SaveChanges(ByVal callingform As Form, ByVal datachange As Boolean, Optional ByVal text As String = Nothing) As Integer<br />
        Dim message As String<br />
        Dim reply As Integer<br />
        Dim fbid As String<br />
        Const QMark As String = "?"<br />
        If text = Nothing Then<br />
            message = "Do u want Save thease Changes"<br />
        Else<br />
            message = text<br />
            text = message<br />
<br />
            If text.Substring(text.Length - 1) <> QMark Then<br />
                text &= QMark<br />
            End If<br />
<br />
        End If<br />
        reply = 1<br />
<br />
        If datachange Then<br />
           <br />
            Select Case MessageBox.Show(text, "Data Changed", MessageBoxButtons.YesNoCancel)<br />
                Case DialogResult.Yes : reply = 0<br />
                Case DialogResult.Cancel : reply = 2<br />
            End Select<br />
        End If<br />
        Return reply<br />
    End Function<br />
<br />
End Module<br />


Then in my windows form coding as follows

//this method is for when user close the form

Private Sub Form_closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Select Case SaveChanges(Me, datachange)
Case 0
If Not DataSavedOK() Then
e.Cancel = True
End If
Case 1

Case 2
e.Cancel = True
End Select

End Sub

Private Function DataSavedOK() As Boolean

datachange = False
Return True

End Function


And i laso created the two variable
one is dim formload as string,datachange as string.
Then i decalre the forload variable into form load.


Actualy this coding also give the correct result but,if i click yes button in the message box i want to update the sql database but unforunatly it doesn't work at all.(Not displaying any errors also)


Pleas can u help for this.
QuestionHow to make code run with 2.0 framework Pin
g6gak16-Jul-06 23:42
g6gak16-Jul-06 23:42 
AnswerRe: How to make code run with 2.0 framework Pin
mr_lasseter17-Jul-06 2:27
mr_lasseter17-Jul-06 2:27 
GeneralRe: How to make code run with 2.0 framework Pin
g6gak17-Jul-06 2:40
g6gak17-Jul-06 2:40 
QuestionHow to add an element to a SOAP envelope? Pin
Peter van der Veen16-Jul-06 23:40
Peter van der Veen16-Jul-06 23:40 
QuestionFilter dataset Pin
ravihd16-Jul-06 22:16
ravihd16-Jul-06 22:16 
AnswerRe: Filter dataset Pin
GuruPandian16-Jul-06 23:26
GuruPandian16-Jul-06 23:26 
GeneralRe: Filter dataset Pin
ravihd16-Jul-06 23:37
ravihd16-Jul-06 23:37 
QuestionHow to create dynamic classes from XML file? Pin
Amol Ravatale16-Jul-06 21:45
Amol Ravatale16-Jul-06 21:45 
QuestionData storage [modified] Pin
codeadair16-Jul-06 21:22
codeadair16-Jul-06 21:22 
AnswerRe: Data storage Pin
Dave Kreskowiak17-Jul-06 1:45
mveDave Kreskowiak17-Jul-06 1:45 
GeneralRe: Data storage Pin
codeadair17-Jul-06 1:53
codeadair17-Jul-06 1:53 
GeneralRe: Data storage Pin
Dave Kreskowiak17-Jul-06 2:47
mveDave Kreskowiak17-Jul-06 2:47 
GeneralRe: Data storage Pin
codeadair17-Jul-06 14:20
codeadair17-Jul-06 14:20 
Questionvb.net HTML viewer (and editor) Pin
t3j016-Jul-06 21:09
t3j016-Jul-06 21:09 
AnswerRe: vb.net HTML viewer (and editor) Pin
Rizwan Bashir16-Jul-06 21:59
Rizwan Bashir16-Jul-06 21:59 
GeneralRe: vb.net HTML viewer (and editor) Pin
t3j017-Jul-06 4:49
t3j017-Jul-06 4:49 
Questionplease help Pin
harish13916-Jul-06 20:43
harish13916-Jul-06 20:43 

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.