-
- VBForums
- Visual Basic
- Visual Basic 6 and Before
- 'dont evidence this message over again'
-
Jun tenth, 2005,03:54 AM #1 Thread Starter New Member '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. -
Jun 10th, 2005,06:22 AM #two 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 -
Jun 10th, 2005,06:34 AM #3 Re: 'dont show this message again' 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 -
Jun 10th, 2005,06:35 AM #4 Re: 'dont testify this message again' Originally Posted past Martfeet edit: this was supposed to be in classic visual basic section. can somebody motility it please? Done -
Jun 11th, 2005,01:27 AM #5 Re: 'dont show this bulletin again' I dont know if this was solved, but.... Registry VB Code: -
Individual Sub Form_Unload(Cancel Equally Integer) -
SaveSetting "RegCust", "Startup", "Backup", strDate -
SaveSetting "RegCust", "Startup", "LastEntry",intLastEntry -
Terminate Sub -
'GetSetting -
Individual Sub Form_Load() -
Dim intLastEntry As Integer -
intLastEntry = GetSetting("RegCust", "Startup", _ -
"LastEntry", "0") -
Stop Sub -
'DeleteSetting -
Private Sub cmdDelKey_Click() -
DeleteSetting "RegCust", "StartUp", "LastEntry" -
End Sub -
Individual Sub cmdDelSection_Click() -
DeleteSetting "RegCust", "StartUp" -
Cease Sub -
Private Sub cmdUnInstall_Click() -
DeleteSetting "RegCust" -
End Sub INI File VB Lawmaking: -
Choice Explicit -
'declares for ini decision-making -
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 -
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 -
Private Declare Function WritePrivateProfileSection Lib "kernel32" Alias "WritePrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpString As String, ByVal lpFileName As String) Every bit Long -
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 -
Private Sub Form_Load() -
On Error Resume Adjacent -
Dim File As String, OFLen As Double, Str As String -
File = "C:\temp.txt" -
OFLen = FileLen(File) -
'write few example sections: -
WriteIniSection File, "Test1", "" -
WriteIniSection File, "Test2", "Here shoud be found some text" -
'write few ini strings -
WriteIni File, "Test3", "Ini1", "This is ini 1" -
WriteIni File, "Test1", "Ini2", "This is ini 2" -
'inform we're written the data -
MsgBox Format((FileLen(File) - OFLen) / 1024, "0.00") & " KB data written to " & Chr(34) & File & Chr(34) -
'read the ini file -
Str = Str & "Test2 section: " & vbTab & ReadIniSection(File, "Test2") & vbCrLf -
Str = Str & "Test1 section: " & vbTab & ReadIniSection(File, "Test1") & vbCrLf -
Str = Str & "Ini1 string: " & vbTab & ReadIni(File, "Test3", "Ini1") & vbCrLf -
Str = Str & "Ini2 cord: " & vbTab & ReadIni(File, "Test1", "Ini2") & vbCrLf -
'testify data -
MsgBox Str -
'terminate application -
End -
End Sub -
'// INI Controlling PROCEDURES -
'reads ini string -
Public Office ReadIni(Filename As String, Section As Cord, Key As String) Every bit String -
Dim RetVal Every bit Cord * 255, v Every bit Long -
v = GetPrivateProfileString(Department, Fundamental, "", RetVal, 255, Filename) -
ReadIni = Left(RetVal, v - 1) -
End Part -
'reads ini section -
Public Office ReadIniSection(Filename As String, Section Every bit String) As String -
Dim RetVal As String * 255, v As Long -
v = GetPrivateProfileSection(Section, RetVal, 255, Filename) -
ReadIniSection = Left(RetVal, v - ane) -
End Function -
'writes ini -
Public Sub WriteIni(Filename Every bit String, Section As String, Fundamental Every bit String, Value As Cord) -
WritePrivateProfileString Department, Key, Value, Filename -
Stop Sub -
'writes ini section -
Public Sub WriteIniSection(Filename Every bit String, Section As String, Value As String) -
WritePrivateProfileSection Section, Value, Filename -
End Sub Both directly from FAQ. Have a await there is some good stuff =) http://vbforums.com/showthread.php?t...t=setting+salvage -
Jun 11th, 2005,01:55 AM #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. -
Jun 11th, 2005,02:08 AM #7 Re: 'dont show this message once more' I thought he was looking for a bank check box on a grade or something :[ -
Jun 11th, 2005,08:04 AM #viii Re: 'dont show this message again' -
- VBForums
- Visual Basic
- Visual Bones 6 and Earlier
- 'dont show this message once 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
Forum Rules | Click Here to Expand Forum to Full Width |
0 Response to "Vbnet Alert Window With Do Not Show Again"
Postar um comentário