deminizer Posted March 31, 2017 Author Share Posted March 31, 2017 Is it possible to remove the background image from via the frmForm code or any other frm ?i would like to remove the Background .jpg please help me what should i delete from my coding```Option ExplicitPrivate Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" ( _ ByVal hWnd As Long, _ ByVal nIndex As Long) As LongPrivate Declare Function SetWindowLong Lib "user32" _ Alias "SetWindowLongA" ( _ ByVal hWnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As LongPrivate Declare Function SetLayeredWindowAttributes Lib "user32" ( _ ByVal hWnd As Long, _ ByVal crKey As Long, _ ByVal bAlpha As Byte, _ ByVal dwFlags As Long) As LongPrivate Const GWL_EXSTYLE = (-20)Private Const WS_EX_LAYERED = &H80000Private Const LWA_COLORKEY = &H1&Private Const LWA_ALPHA = &H2&Private Sub cmbClass_Click() newCharClass = cmbClass.ListIndex newCharSprite = 0End SubPrivate Sub Form_Load() 'Set the Form transparent by color. BackColor = RGB(127, 127, 0) 'Unique but explicit (non-system) color. SetWindowLong hWnd, _ GWL_EXSTYLE, _ GetWindowLong(hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED SetLayeredWindowAttributes hWnd, BackColor, 0, LWA_COLORKEY Dim tmpTxt As String, tmpArray() As String, i As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler ' general menu stuff Me.Caption = Options.Game_Name ' load news Open App.Path & "\data files\news.txt" For Input As #1 Line Input #1, tmpTxt Close #1 ' split breaks tmpArray() = Split(tmpTxt, "") lblNews.Caption = vbNullString For i = 0 To UBound(tmpArray) lblNews.Caption = lblNews.Caption & tmpArray(i) & vbNewLine Next ' Load the username + pass txtLUser.text = Trim$(Options.Username) If Options.SavePass = 1 Then txtLPass.text = Trim$(Options.Password) chkPass.Value = Options.SavePass End If ' Error handler Exit Suberrorhandler: HandleError "Form_Load", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler resetButtons_Menu ' Error handler Exit Suberrorhandler: HandleError "Form_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub Form_Unload(Cancel As Integer) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If Not EnteringGame Then DestroyGame ' Error handler Exit Suberrorhandler: HandleError "Form_Unload", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub imgButton_Click(Index As Integer) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Select Case Index Case 1 If Not picLogin.Visible Then ' destroy socket, change visiblity DestroyTCP picCredits.Visible = False picLogin.Visible = True picRegister.Visible = False picCharacter.Visible = False picMain.Visible = False ' play sound PlaySound Sound_ButtonClick, -1, -1 End If Case 2 If Not picRegister.Visible Then ' destroy socket, change visiblity DestroyTCP picCredits.Visible = False picLogin.Visible = False picRegister.Visible = True picCharacter.Visible = False picMain.Visible = False ' play sound PlaySound Sound_ButtonClick, -1, -1 End If Case 3 If Not picCredits.Visible Then ' destroy socket, change visiblity DestroyTCP picCredits.Visible = True picLogin.Visible = False picRegister.Visible = False picCharacter.Visible = False picMain.Visible = False ' play sound PlaySound Sound_ButtonClick, -1, -1 End If Case 4 Call DestroyGame End Select ' Error handler Exit Suberrorhandler: HandleError "imgButton_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub imgButton_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler ' reset other buttons resetButtons_Menu Index ' change the button we're hovering on changeButtonState_Menu Index, 2 ' clicked ' Error handler Exit Suberrorhandler: HandleError "imgButton_MouseDown", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub imgButton_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler ' reset other buttons resetButtons_Menu Index ' change the button we're hovering on If Not MenuButton(Index).state = 2 Then ' make sure we're not clicking changeButtonState_Menu Index, 1 ' hover End If ' play sound If Not LastButtonSound_Menu = Index Then PlaySound Sound_ButtonHover, -1, -1 LastButtonSound_Menu = Index End If ' Error handler Exit Suberrorhandler: HandleError "imgButton_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub imgButton_MouseUp(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler ' reset all buttons resetButtons_Menu -1 ' Error handler Exit Suberrorhandler: HandleError "imgButton_MouseUp", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub lblLAccept_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If isLoginLegal(txtLUser.text, txtLPass.text) Then Call MenuState(MENU_STATE_LOGIN) End If ' Error handler Exit Suberrorhandler: HandleError "lblLAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub lblSprite_Click()Dim spritecount As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If optMale.Value Then spritecount = UBound(Class(cmbClass.ListIndex + 1).MaleSprite) Else spritecount = UBound(Class(cmbClass.ListIndex + 1).FemaleSprite) End If If newCharSprite >= spritecount Then newCharSprite = 0 Else newCharSprite = newCharSprite + 1 End If ' Error handler Exit Suberrorhandler: HandleError "lblSprite_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub optFemale_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler newCharClass = cmbClass.ListIndex newCharSprite = 0 ' Error handler Exit Suberrorhandler: HandleError "optFemale_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub optMale_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler newCharClass = cmbClass.ListIndex newCharSprite = 0 ' Error handler Exit Suberrorhandler: HandleError "optMale_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub picCharacter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler resetButtons_Menu ' Error handler Exit Suberrorhandler: HandleError "picCharacter_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub picCredits_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler resetButtons_Menu ' Error handler Exit Suberrorhandler: HandleError "picCredits_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub picLogin_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler resetButtons_Menu ' Error handler Exit Suberrorhandler: HandleError "picLogin_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub picMain_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler resetButtons_Menu ' Error handler Exit Suberrorhandler: HandleError "picMain_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub picRegister_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler resetButtons_Menu ' Error handler Exit Suberrorhandler: HandleError "picRegister_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub tmrUpdateCredits_Timer()' Don't update if menu is not visible If frmMenu.Visible = False Then Exit Sub ' If we're connected we don't need to update anything If IsConnected Then Exit Sub ' If the the timer is paused but we're not connected clear it If StopTimer = True And IsConnected = False Then StopTimer = False End If ' Check if the timer is disabled If StopTimer Then Exit Sub If ConnectToServer(1) Then Call UpdateData StopTimer = True End If If IsConnected = False Then frmMenu.lblCredits.ForeColor = vbRed frmMenu.lblCredits.Caption = "Loading Error from server" frmMenu.lblServerStatus.Visible = True End IfEnd SubPrivate Sub tmrUpdateNews_Timer()' Don't update if menu is not visible If frmMenu.Visible = False Then Exit Sub ' If we're connected we don't need to update anything If IsConnected Then Exit Sub ' If the the timer is paused but we're not connected clear it If StopTimer = True And IsConnected = False Then StopTimer = False End If ' Check if the timer is disabled If StopTimer Then Exit Sub If ConnectToServer(1) Then Call UpdateData StopTimer = True End If If IsConnected = False Then frmMenu.lblServerStatus.Caption = "Offline" frmMenu.lblServerStatus.ForeColor = vbRed frmMenu.lblNews.Caption = "The server appears to be offline. Please try connecting again later." frmMenu.lblServerStatus.Visible = True End IfEnd SubPrivate Sub tmrUpdateVersion_Timer()' Don't update if menu is not visible If frmMenu.Visible = False Then Exit Sub ' If we're connected we don't need to update anything If IsConnected Then Exit Sub ' If the the timer is paused but we're not connected clear it If StopTimer = True And IsConnected = False Then StopTimer = False End If ' Check if the timer is disabled If StopTimer Then Exit Sub If ConnectToServer(1) Then Call UpdateData StopTimer = True End If If IsConnected = False Then frmMenu.lblVersion.ForeColor = vbRed frmMenu.lblVersion.Caption = "Error" frmMenu.lblServerStatus.Visible = True End IfEnd Sub' RegisterPrivate Sub txtRAccept_Click() Dim Name As String Dim Password As String Dim PasswordAgain As String ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Name = Trim$(txtRUser.text) Password = Trim$(txtRPass.text) PasswordAgain = Trim$(txtRPass2.text) If isLoginLegal(Name, Password) Then If Password <> PasswordAgain Then Call MsgBox("Passwords don't match.") Exit Sub End If If Not isStringLegal(Name) Then Exit Sub End If Call MenuState(MENU_STATE_NEWACCOUNT) End If ' Error handler Exit Suberrorhandler: HandleError "txtRAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub' New CharPrivate Sub lblCAccept_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Call MenuState(MENU_STATE_ADDCHAR) ' Error handler Exit Suberrorhandler: HandleError "lblCAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```Or please tell me how to change my picture format to .gif or png Link to comment Share on other sites More sharing options...
deminizer Posted April 1, 2017 Author Share Posted April 1, 2017 Bump~Help me remove theEclipse Renewal 1.7.0\Eclipse Renewal 1.7.0\client\data files\graphics\gui\menu\background.jpgFrom VB6 formPFA attachment for more details Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted April 1, 2017 Share Posted April 1, 2017 Click the form, go into the properties tab/menu and there should be a "Background:" that you can change. Link to comment Share on other sites More sharing options...
deminizer Posted April 1, 2017 Author Share Posted April 1, 2017 @'Mohenjo:> Click the form, go into the properties tab/menu and there should be a "Background:" that you can change.There is no background in properties tab there is a picture tab but picture is not inserted Link to comment Share on other sites More sharing options...
Kemono Posted April 1, 2017 Share Posted April 1, 2017 You can only insert BMP pictures in VB6 , and yes it's the picture tab… To insert a gif in your main with VB6 , you must download Gif dll or ocx and add it to your project's dlls . then select it from your tools and put your GIF in . I can't help more for free lol , that's why I gave your my skype . Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted April 2, 2017 Share Posted April 2, 2017 If I get around to it, I'll add something that recognizes when there are multiple files in the folder and plays them (so long as they are correctly named). I've written a note of it, so we'll see if it gets added :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now