Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Initialize ImageList (Deals With Plugin)

VB6 (YAY! ;D)

My Plugin contains the ImageList that I am adding to my ListView, which is in my main project. I am able to add the ImageList TO the ListView

PlugY(NameToIndex("Form1")).RoomList.SmallIcons = Form1.ClientIcons
but I'm not sure how to initialize it. I've seen Set ...Roomlist.SmallIcons = Form1.ClientIcons but that is not seeming to do the job from my plugin.

Ideas/Help appreciated.

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
ImageList Won't Initialize
The error, as you know, is "ImageList must be initialized before it can be used."

EDIT: Resolved by right clicking the listview, choosing "Properties", click on "Image Lists", and set all three combos to "ImageList".

Initialize ImageList In An ActiveX-Control
I'm trying to write an ActiveX-Control, in which i use a TreeView-Control.
But if i made my OCX-file and use the control in a new project i've got the
error: ImageList must be initialized.

How can I avoid this error?

Thanks in advance


Search Website For Best Deals?
How would i search a certain airline website for the lowest prices available? through a VB app

Their source is written in JS on an ASP page, the source holds arrays of values for the destinations and dates etc..

Is there a way i can automate selection through VB. Say i wanted to fly around a certain time to a certain place, can i search their db from my app and return the best possible prices?

Sorry, Non Vb Question - Deals With Yahoo Email
Hi Everyone,

Does anyone know how to transfer the address book information from one email account and place it into another email account fairly easily? I am trying to do this in yahoo. Thanks for any help.

Listview And ImageList. Cannot Pick Up Icons From ImageList
Evening everybody,

I have been searching the internet and this forum for hours trying to find a resolution to this problem. I cannot seem to link my Imagelist and Listview controls.

My end result is that I'd like to have a listview control in report view with an icon displayed next to each record.

I have added a listview control (listview1) and an imagelist control (imagelist1) to a form.

In ImageList1 properties I have gone into Custom, Images tab and Inserted two .bmp files

Now in Listview1 I have gone into Custom, Image Lists tab and clicked on the combo box entitled Small and I only can see <None> displayed.

Every forum and internet site states that I should be able to pick up the listview control. I know I must be doing something fundamentally wrong, but cannot figure out what it is. Any help much appreciated

<Edit> AbbydonKrafts - Moved to VB Controls & ActiveX </Edit>

Edited by - AbbydonKrafts on 10/16/2006 2:39:06 PM

Listview And ImageList. Cannot Pick Up Icons From ImageList
Evening everybody,

I have been searching the internet and this forum for hours trying to find a resolution to this problem. I cannot seem to link my Imagelist and Listview controls.

My end result is that I'd like to have a listview control in report view with an icon displayed next to each record.

I have added a listview control (listview1) and an imagelist control (imagelist1) to a form.

In ImageList1 properties I have gone into Custom, Images tab and Inserted two .bmp files

Now in Listview1 I have gone into Custom, Image Lists tab and clicked on the combo box entitled Small and I only can see <None> displayed.

Every forum and internet site states that I should be able to pick up the listview control. I know I must be doing something fundamentally wrong, but cannot figure out what it is. Any help much appreciated

Treeview Control Without Imagelist/using System Imagelist In Treeview
I am reposting this here because I didn't get a response in the VB 5/6 forum. The getfileinfo api function returns the system imagelist (?) and index to the files icon. Is there a way of using this list and index in the treeview control ? Any help would be appreciated

I am writing an applicatiion that simulates explorer using the treeview control. I've been able to extract the icon from a file using the WinApi but have not found an example where I can use a picture without an imagelist. Its impractical to add all the files on a system to an image list.

Is there a way to do this ?


Michael Zwijacz

When You Should Initialize...
in vb6, when do you think it is best to initialize the values of objects such as size, fonts, colors, etc etc of forms, buttons, frames and etc? should it be initialize in the properties menu or using coding to initialize it? or during the run-time? can anyone tell me what's the difference anyway and which one is better?

How To Run Initialize Again?
How can i force a especific form to run initiazile again evertime i use the "", or maybe the trick relies on the way i close the form?

I think it's because of the "form.hide" am using, it justs hides it but it remains resident in memory so the initialize will not run... well that's my theory?

tks 4 ur attention and possibel help!

Cannot Initialize OLE

Our appln is in VB and uses Crystal Reports 7 and database is MS ACESS. Everything was working fine in our organization. Now when our clients tries to pull any report, it throws "Cannot Initialize OLE".After clicking OK its again throwing "Error 20534 - Error detected by database dll" error message.
But it works fine for us here.

Any idea how to rectify it...

Your help is much appreciated.

Thanks in advance

Why Do You Initialize ?
I don't understand why you are supposed to initialize things like controls and such with coding, other than to maybe help forms load faster? I don't know?

I am reading Sam's... 24 hours on page 187, and, for example:

Private Sub Form_Load()
' Initialize the label's text
Dim strLabel1 As String
Dim strLabel2 As String
Dim strLabel3 As String
Dim strLabel4 As String

strLabel1 = "Use frames if you want "
strLabel2 = "to group options together. "
strLabel3 = "Each frame forms one set "
strLabel4 = "of option buttons."

lblFrames.Caption = strLabel1 & strLabel2 & strLabel3 & strLabel4


The rest of the code isnt needed for my question, and the code simply demostrates the option box controls to change various font properties in a large label box.

I must have missed something, because I understand initializing variables before use, but why go through all that code to change font in a label?

How Do I Initialize An Array
Very simple question but I I can't seem to find the answer.

I have a few array defined as follows

Public WorkOrder(20) As String

How would initialize the array?

Also does it only initialize in the when the program is started since it is public?

Thanks for help

Initialize COM Port??
I have initialize the com port as follows.

Private Sub Form_Load()
Mscomm1.Commport = 2
Mscomm1.Setting = "9600,N,8,1"
End Sub

but i get an errot of run time error "424"
object required..

Do I missing anything?


Initialize Directdraw
i saw a good C# tutorial. it explains everything THOROUGHLY

i tried converters and everything to make it work in VB but it didnt work

can some1 tell me how to do the same in VB(using the same way they did it on the site)

i see different ways like:

ref m_objSizeRECT,

that gets too complicated!!!

the way they teach you on the site is easy and it makes sense. DirectX 9.0a doesnt have the wizards for Visual Studio.NET to do it, so i need some1 to help me initialize directDraw in DirectX9.0a in VB.NET

i saw other ways to do it on VB but not VB.NET

How To Initialize Connection
I have to distribute data from one server to another using telephone line. I do not use methods of replication embeded into MS SQL Server 2000 but instead of this I wrote my own T-SQL stored procedure which transfers data from server to server.
As I run this procedure from VB code "only" I haveto do before is to establish phone connection between servers. I ask, how to initialize connection, or how to dial number from VB code if I use serial modem (or modem attached to one of seriasl ports) or if I use ISDN modem.
I think I can dial remote number using MSCOMM control but I do not know how to realise that connection is established or not and if I should run transaction or not.

Form Does Not Initialize
Okay, my form (with textboxes) is filled with data from the active document. The following shows what problem I am having:
1. User runs macro which opens a document called "2001.xls" then executes dataForm.Show
1. User hits Done_Click which executes Unload Me
2. User closes active document (basic close) but doesn't close Excel.
3. User runs macro which opens another document called "2002.xls" then executes dataForm.Show
3. Form contains data from the previous document called 2001.xls.

This happens when I use Unload Me or just dataForm.Hide
The problem, I believe, is that the second time the macro is run and dataForm.Show is executed, the form does not initialize (UserForm_Initialize).

Any thoughts?

Initialize MsFlexgrid

Using Access2000, VB6, ADO 2.7

Could someone tell me how to initialze a MsFlexgrid?

I have a grid that get populted, and items eventualy also get removed.
When I remove the last entry, I need to refresh the grid. My current fix is to simply change the property to not visible.
What I really want to do is to show the grid but empty. can someone point me in the right direction?

Thanks for your replies

Using END In The Initialize Event
I know that using End in VB coding is a bad idea but what about in the Form_Initialize event?

Private Sub Form_Initilize()

'Check for App already running.
If App.PrevInstance then
Set Me = Nothing
End If

'Check for valid Registry data.
Dim ReadReg As New cRegAccess
With ReadReg
if .Name = "" Then
'No valid data exhists.
Set ReadReg = Nothing
Set Me = Nothing
Me.Caption = .Name
Set ReadReg = Nothing
End If

End Sub

Initialize Database
Hi All,
I have an Access database that I would like to re-use with new data. Is it possible to clear the existing DB without having to delete record by record? Any code wouls be appreciated.


Initialize The Datareport

I want to use the initialize procedure to initialize the label's caption.

private sub dataReport_initialize()

rptLabel1.caption="Hello world"

end sub

but it didn't work. I don't know why. What can I do?, please help~

Load And Initialize
I've read somewhere that either the load or the initialize event handlers should be used but not both (same for unload and terminate). What is then the purpose of having 2 similar events? What are the differences between either event if any?

Re-initialize A Listview
How do I completely clear a listview, i.e., not just clear the data (listview1.listitems.clear) but also how do you clear the headers?

Listview Won't Initialize
I'm using this code to initialize a listview:

Private Sub InitListView2()
Dim lvw As Single

lvw = ListView2.Width

With ListView2.ColumnHeaders

.Add , "Name", "Name", lvw * 0.48
.Item("Name").Tag = LVTypeString
.Add , "Address", "Address", lvw * 0.48
.Item("Address").Tag = LVTypeString

End With

End Sub

and for some reason it isn't working: does nothing.

The LV control is inside a (parent) frame control.

Initialize A Class
Hi, I want to initialize a variable having the name of a class. Is is possible or not? Thanks!


Failed To Initialize
edit: resolved

thanks a load for the help though.

Initialize An Array
Is there a way to initialize an array when you redim it?

VB Code:
'For example I want all the elements to equal trueRedim AddClass(1 to rs.RecordCount) = True 'This obviously doesn't work. Is there a way of doing this'without doing a for loop and going through each element?  

Re-initialize Registry
does anyone have any code to re-initialize the registry without rebooting? Anything appreciated.

Initialize Variables
after reading one file and before reading another I would like to initial my variables (all 72 of them) to zero. Is there an easy way to do this

Initialize Vs. Load
When and why would you use the Form_Initialize event rather than the Form_Load event?

Form Initialize
I load and unload a form. The first time the form gets initialized but after that it doesn't. I have code in the form_initialized
event that needs to run each time the form is run. Unloading the form doesn't seem to be enough. What am I missing? Can anyone tell me what I should be using instead of Unload? Thanks

Unable To Initialize
After installing the software packaged by using the Package and deployment wizard. When I execute it. It displays the error while loading the program.

Unable to initalize VBJET16.dll or VBJET32.dll error no. 3447.

Please tell reason and suggest solution to this.;

How Can I Initialize The IRTCPortManager?
I am trying to use the IRTCPortManager::GetMapping method, but the IRTCPortManager interface can not New, CreateObject, and can not initialize it, so I can not use SetPortManager to make the IRTCPortManager point valid. Who can tell me how can I initialize the IRTCPortManager in Visual Basic? Thank you very much

Initialize Datareport
am doing a project in vb,in that project am using datareport without datareport designer,how can i change the font of label or textbox in the my table am using two fonts for storing two datas in two i want to print that data in corresponding language also .if there is a possibility to change the font of datareport label or textbox,then i can easily generate the report .please help me

How To Initialize Database?
I'm trying to init the database which will only effect the admin users. Can anyone help me out?

Direct-X 8 Won't Initialize Under XP
I have Direct-X 9 on both my Windows 98 and XP partitions, and I've got two DX8 sprite engines that I'm looking at to see how to upgrade my project from DX7 DirectDraw to DX8. Under XP though, I always get an "automation error" when Direct-X is initialized. Same code, same hardware, but it doesn't work under XP. Any idea what could be wrong?

I don't really want to use DX8 even, but I need the ability to rotate my sprites, which DX7 can't do apparently.

Initialize Array
Could anyone help me with the code to initialize the array

"zipattachmentlst(9999)" is a string type


Initialize FTP Object
I'd like to download some files from an FTP server by VBS (script), however I don't know how to initialize the FTP ActiveX object.

Thanks in advance

Initialize The Array
Hi all,

If you I have UDT like C++;
struct XcvrSAPInfo
BYTE bitmap[8]; // 8 bytes
BYTE sapIDs[64]; // 64 bytes
UCHAR xcvrSAPId; // 1 byte
UCHAR xcvrSAPAddr; // 1 byte

In c++ we can initialize viariable as following
XcvrSAPInfo xsi = {

My question is:
(1) how to do the same thing in VB?
(2) Please tell me how to assign Hex constant in VB?


Nemox Initialize Error
Hi guys

When i run the intialize function in Nemox i have "Subscript out of range" error

Is there anybody, who knows the reason of this error?

Form Activate And Initialize
What is the difference between Form initialize and form Activate? When I say form Form1.Show() which of the events trigger?

Here is the problem I have. When ever I say Form.Show() I want the program to do some stuff. Right now I have all that code in Form_Activate. I also have a modal form that I open on and off on top of the other form. But every time I close the modal form Form_Active triggers. So I want to put the code thats in Form_Activate some where else so whenever I say Form.Show() it will run that code. I already tried form load and it doesnt work.

How Can I Initialize A Combobox In Powerpoint

How can I initialize a combobox so it contains information in Powerpoint when I start the presentation?
As for now I must manuallu run Private Sub Slide1_Load(). Then start the presentation. Now the combobox is loaded.

I know that I must use --> Initialize() , but how?


Private Sub Slide1_Load()

ComboBox1.AddItem "Choose a page" 'ListIndex = 0
ComboBox1.AddItem "Apple" 'ListIndex = 1
ComboBox1.AddItem "Microsoft" 'ListIndex = 2
ComboBox1.AddItem "IBM" 'ListIndex = 3

ComboBox1.ListIndex = 0

End Sub

Private Sub ComboBox1_Click()

Dim IE As InternetExplorer
Set IE = New InternetExplorer

Select Case ComboBox1.ListIndex

Case 0

Case 1 'Apple
IE.Visible = True
IE.Navigate ("")

Case 2 'M$
IE.Visible = True
IE.Navigate ("")

Case 3 'IBM
IE.Visible = True
IE.Navigate ("")

End Select

ComboBox1.ListIndex = 0

End Sub

Form Initialize Event
I have a few lines of code in the _Initialize event that I can't put in the Load event because of, among other, some late-binding objects in the form.

It works fine in the _Init.. event but that event fires every time the form looses then regains focus. This is the source of a bug that I've been tracking down for a few days and now I need to remedy it.

I thought about creating a Boolean variable with form level scope that I can use to determine if this is the first time the code has been ran, and I'm sure this will work, but I was just curious what all of you would do in this case. I know this is a common problem and I'm sure you've had to come up with a solution sometime, so let's hear it!

I did a quick check to see if the code will work in the _Activate event but that's a no-go as well

Also, I *really* hate it when I see code where people rig up a timer in the form_load to do this--so i don't even consider this and similar hacks to be viable solutions.

Thanks for your input.


Application Failed To Initialize?
When I try to run my VB Program on other computer, it comes up with a message saying "Application Failed to Initialize". I feel like I forgot to do something in Visual Studio, but what? I used some free installer also, but it still didn't work.

Load, Initialize, Activate...
I don't understand the difference between the Load, Initialize, and Activate events in a form as well as Unload, Terminate, and Deactivate. What's the order and why are there so many different events?

Thanks a lot

Cannot Initialize Data Bindings ???
What could be the possible reason of this error?

I get this error when trying to fill the datagrid..

Variable Initialize Problem
I have a code <Public C As Integer = 0 > in module,
I got an error <Expected: end of statement>,

How To Initialize A Picture Box Control
I am working on an old project that used picturebox controls as their main text entry fields.

I need to initialize the picturebox controls on my form but i keep getting an "invalid field data type" Error

Just wondering if anyone can tell me how to initialize a picturebox control to use for text.

This is what i have:

VB Code:
Picture1 = ""

How To Initialize A Two-dimensional Array
Hello Everybody,

We can initialize a one dimensional array in VB 6.0 as shown below

Dim Data(), N As Integer

Private Sub Combo1_Click()
Text1.Text = Combo1.Text
End Sub

Private Sub Form_Load()
Data = Array("Abc", "Pqr", "Uvw", "Xyz")
For N = 0 To UBound(Data)
Combo1.AddItem Data(N)
'This will initially display the first page
Combo1.ListIndex = 0
End Sub

But Similarly how to initialize a two-dimensional Array. Following line is coming out of an error.

Dim Data1()

Data1(1 To 2, 1 To 3) = ((EVA, MSA), (RA, MA8000), (Xyz, Pqr))

I have huge data like this to be assigned to a two-dimensional array:

EVA 72GB 11111-111
MSA 36GB 22222-222
MSA 36GB 33333-333
MSA 72GB 44444-444
RA 18GB 55555-555
RA 36GB 66666-666
And so on..

Thanks in Advance !!


Dim Statement Can't Initialize Variables
Dim statement can't initialize my variables at form load. Why so?

For example -

start new std exe project,
place a command button on form1 and in it's click event add this - Form2.Show
add another form - form2.
In the form2's code window add this

VB Code:
Dim cntr As Integer Private Sub Form_Load()   Debug.Print cntr   cntr=cntr+1End Sub

And try showing form2 by clicking command button and closing form2 few more times
Every time it adds its counter by 1 and displays it in debug window.

Is this it's behavour(scope of variable)?

Copyright 2005-08, All rights reserved