Vbnet Alert Window With Do Not Show Again

  1. #1

    Martfeet is offline

    Thread Starter

    New Member Martfeet's Avatar


    'dont testify this message once again'

    i accept a msgbox that appears when my vb .exe opens. tin can i make it so theres a 'dont show this message once again' button?

    i retrieve it involves savign something, and someone said i could save things to the registry, just i accept no idea how. can i save it into the .exe file?

    Thanks, Martfeet. (vb6.0)

    programming n00b.

    edit: this was supposed to be in classic visual basic department. can somebody move information technology please?

    Last edited by Martfeet; Jun 10th, 2005 at 04:01 AM.

  2. #two

    ns-code is offline

    Fond Member


    Re: 'dont show this bulletin once again'

    Message boxes can't take custom button captions. You lot can merely use the predefined ones. And so, to have a "Don't show again" button, or fifty-fifty ameliorate a checkbox, yous need to make a form for information technology. Alternatively you could say to your user "Abolish = Don't show over again", but that'south dull.

    To save settings to registry apply SaveSettings procedure, and to get them back use LoadSettings role.

    ( : ns-lawmaking : )
    FCP Products


  3. #3

    Re: 'dont show this message again'

    Quote Originally Posted past ns-code

    Message boxes can't have custom push button captions. Yous can simply use the predefined ones. So, to have a "Don't show over again" button, or even ameliorate a checkbox, you need to make a grade for it. Alternatively you could say to your user "Cancel = Don't show again", but that'due south irksome.

    To relieve settings to registry utilise SaveSettings procedure, and to get them back use LoadSettings function.

    Yes but yous can cheet the system.

    You design a form which looks similar a bulletin box and then you tin customise the buttons,

    As for the Dont Show This once more, yes you will have to save a bit of infomation in a file or in the registry here is how i did it a while back,

    added a textfile (.INI) to my project root which conatined a hash sign # the plan opened upward the file if it found a has sign information technology displayed a message and if the user said they dont wnat to see it again it replaced the hash sign with a * very simple to do, not 100% foolproof. Simply worked, you could alternativly employ the registry it is pretty like shooting fish in a barrel to do, take a look in the codebank I think MartinLiss posted a skillful guide on how to save and edit.

    Pino


  4. #4

    Re: 'dont testify this message again'

    Quote Originally Posted past Martfeet

    edit: this was supposed to be in classic visual basic section. can somebody motility it please?

    Done

  5. #5

    Re: 'dont show this bulletin again'

    I dont know if this was solved, but....

    Registry

    VB Code:

                                    
    1. Individual Sub Form_Unload(Cancel Equally Integer)

    2.    SaveSetting "RegCust", "Startup", "Backup", strDate

    3.    SaveSetting "RegCust", "Startup", "LastEntry",intLastEntry

    4. Terminate Sub

    5. 'GetSetting

    6. Individual Sub Form_Load()

    7.    Dim intLastEntry As Integer

    8.    intLastEntry = GetSetting("RegCust", "Startup", _

    9.    "LastEntry", "0")

    10. Stop Sub

    11. 'DeleteSetting

    12. Private Sub cmdDelKey_Click()

    13.    DeleteSetting "RegCust", "StartUp", "LastEntry"

    14. End Sub

    15. Individual Sub cmdDelSection_Click()

    16.    DeleteSetting "RegCust", "StartUp"

    17. Cease Sub

    18. Private Sub cmdUnInstall_Click()

    19.    DeleteSetting "RegCust"

    20. End Sub


    INI File

    VB Lawmaking:

                                    
    1. Choice Explicit

    2. 'declares for ini decision-making

    3. Private Declare Function GetPrivateProfileSection Lib "kernel32" Alias "GetPrivateProfileSectionA" (ByVal lpAppName Every bit String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) Every bit Long

    4. Private Declare Office GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Whatever, ByVal lpDefault Every bit String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) Every bit Long

    5. Private Declare Function WritePrivateProfileSection Lib "kernel32" Alias "WritePrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpString As String, ByVal lpFileName As String) Every bit Long

    6. Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Whatever, ByVal lpString Equally Any, ByVal lpFileName As String) Equally Long

    7. Private Sub Form_Load()

    8. On Error Resume Adjacent

    9. Dim File As String, OFLen As Double,  Str As String

    10. File = "C:\temp.txt"

    11. OFLen = FileLen(File)

    12. 'write few example sections:

    13. WriteIniSection File, "Test1", ""

    14. WriteIniSection File, "Test2", "Here shoud be found some text"

    15. 'write few ini strings

    16. WriteIni File, "Test3", "Ini1", "This is ini 1"

    17. WriteIni File, "Test1", "Ini2", "This is ini 2"

    18. 'inform we're written the data

    19. MsgBox Format((FileLen(File) - OFLen) / 1024, "0.00") & " KB data written to " & Chr(34) & File & Chr(34)

    20. 'read the ini file

    21. Str = Str & "Test2 section: " & vbTab & ReadIniSection(File, "Test2") & vbCrLf

    22. Str = Str & "Test1 section: " & vbTab & ReadIniSection(File, "Test1") & vbCrLf

    23. Str = Str & "Ini1 string: " & vbTab & ReadIni(File, "Test3", "Ini1") & vbCrLf

    24. Str = Str & "Ini2 cord: " & vbTab & ReadIni(File, "Test1", "Ini2") & vbCrLf

    25. 'testify data

    26. MsgBox Str

    27. 'terminate application

    28. End

    29. End Sub

    30. '// INI Controlling PROCEDURES

    31. 'reads ini string

    32. Public Office ReadIni(Filename As String, Section As Cord, Key As String) Every bit String

    33. Dim RetVal Every bit Cord * 255, v Every bit Long

    34. v = GetPrivateProfileString(Department, Fundamental, "", RetVal, 255, Filename)

    35. ReadIni = Left(RetVal, v - 1)

    36. End Part

    37. 'reads ini section

    38. Public Office ReadIniSection(Filename As String, Section Every bit String) As String

    39. Dim RetVal As String * 255, v As Long

    40. v = GetPrivateProfileSection(Section, RetVal, 255, Filename)

    41. ReadIniSection = Left(RetVal, v - ane)

    42. End Function

    43. 'writes ini

    44. Public Sub WriteIni(Filename Every bit String, Section As String, Fundamental Every bit String, Value As Cord)

    45. WritePrivateProfileString Department, Key, Value, Filename

    46. Stop Sub

    47. 'writes ini section

    48. Public Sub WriteIniSection(Filename Every bit String, Section As String, Value As String)

    49. WritePrivateProfileSection Section, Value, Filename

    50. End Sub


    Both directly from FAQ. Have a await there is some good stuff =)

    http://vbforums.com/showthread.php?t...t=setting+salvage


  6. #6

    Re: 'dont show this message again'

    For the custom Messagebox, what you could do is, every bit Pino and ns-lawmaking said, make a grade with your bulletin, buttons, and bank check box, and then make a function that shows that form and simply returns when one of the buttons has been clicked. That manner you reach the aforementioned effect every bit the built-in MsgBox.

  7. #7

    Re: 'dont show this message once more'

    I thought he was looking for a bank check box on a grade or something :[

  8. #viii

    Re: 'dont show this message again'


Posting Permissions

  • You may not postal service new threads
  • Y'all may not post replies
  • You may not mail attachments
  • You may not edit your posts
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] lawmaking is On
  • HTML lawmaking is Off

Click Here to Expand Forum to Full Width

smithhartur.blogspot.com

Source: https://www.vbforums.com/showthread.php?343952-dont-show-this-message-again

0 Response to "Vbnet Alert Window With Do Not Show Again"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel