Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Background format


deminizer
 Share

Recommended Posts

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 Explicit
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" ( _
ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" ( _
ByVal hWnd As Long, _
ByVal crKey As Long, _
ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_COLORKEY = &H1&
Private Const LWA_ALPHA = &H2&
Private Sub cmbClass_Click()
newCharClass = cmbClass.ListIndex
newCharSprite = 0
End Sub

Private 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 Sub
errorhandler:
HandleError "Form_Load", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "Form_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "Form_Unload", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "imgButton_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "imgButton_MouseDown", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "imgButton_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "imgButton_MouseUp", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "lblLAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "lblSprite_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "optFemale_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "optMale_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "picCharacter_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "picCredits_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "picLogin_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "picMain_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 Sub
errorhandler:
HandleError "picRegister_MouseMove", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

Private 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 If
End Sub

Private 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 If
End Sub

Private 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 If
End Sub

' Register
Private 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 Sub
errorhandler:
HandleError "txtRAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

' New Char
Private 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 Sub
errorhandler:
HandleError "lblCAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
Err.Clear
Exit Sub
End Sub

```
Or please tell me how to change my picture format to .gif or png
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...