VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



all about using resources in your program

by vman (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 26th May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

all about using resources in your program

Rate all about using resources in your program




'To load Bitmap Resource

LoadResPicture(101, vbResBitmap)

'To Load Cursor Resource

LoadResPicture(101, vbResCursor)

'To Load Icon Resource

LoadResPicture(101, vbResIcon)

'Example add a CommandButton to you form add an image to your Resource.

Private Sub Command1_Click()
Command1.Picture = LoadResPicture(101, vbResBitmap)

End Sub

'Using the String Table Resource
'Enter your string and to load it


Text1.Text = LoadResString(101)

'A CUSTOM text resource 
'You Need A textbox and a text file for a CUSTOM Resource

'to print all the text to textbox
 Dim txt As String
 txt = LoadResData(101, "CUSTOM")
 txt = StrConv(txt, vbUnicode)

Text1.Text = txt

'To display a certain line and not all
 Dim txt As String
 txt = LoadResData(101, "CUSTOM")
 txt = StrConv(txt, vbUnicode)
 lines = Split(txt, vbCrLf)
Text1.Text = lines(1) 'This displays the second line

'To extract a Resource

Dim File     As Integer
Dim Data() As Byte

Data = LoadResData(101, "CUSTOM")

File = FreeFile
Open "C:\FileName.ext" For Binary As #File   'example FileName.exe,txt,ico or what ever type of file it is.
   Put #File, 1, Data()
Close #File

Erase Data




Download this snippet    Add to My Saved Code

all about using resources in your program Comments

No comments have been posted about all about using resources in your program. Why not be the first to post a comment about all about using resources in your program.

Post your comment

Subject:
Message:
0/1000 characters