See Related Forum Messages: Follow the Links Below to View Complete Thread
Save Controls After Dynamically Loading Them
I have written some code that at this point simply adds a Command Button at the exact Mouse Coordinate postion of the Cursor
Not even sure what made me want to do it just did but after doing an Idea to Tweak for somethng useful came to mind.
I am going to change it so that it loads small IMages like a ThumbTack or something you would mark a map with like a push pin.
Anyway, I plan on placing the Image in an Image control and spawn it just like I am doing the buttons.
My question is how do I save them so that when I load the next time they will be there.
Here is my code
Code:
Dim Xcoord As Integer
Dim ycoord As Integer
Private Sub Form_Click()
Static intInd
Dim strCap As String
intInd = intInd + 1
Index = intInd
Load cmdSpawn(Index)
cmdSpawn(Index).Visible = True
cmdSpawn(Index).Top = ycoord
cmdSpawn(Index).Left = Xcoord
If chk1.Value = 1 Then
strCap = InputBox("Add your Caption for the button you added", "Caption", "Type Here")
cmdSpawn(Index).Caption = strCap
Else
cmdSpawn(Index).Caption = "Button " & intInd & "-" & " X " & Xcoord & ", " & "Y " & ycoord
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.Caption = "Mouse coordinates: (" & "X-" & X & "," & "Y-" & Y & ")"
Xcoord = X
ycoord = Y
statBar.SimpleText = "Mouse Corrdinates: " & " " & X & ", " & Y
End Sub
Anyhelp or push in the right direction apprecaited
vbMarkO
Dynamically Loading A Frame With Controls
I have a frame that contains various controls. The frame and the controls inside are all control arrays.
So all I want to do is dynamically copy/load the frame and its contained controls.
I can load addtional frames, but I cant find a way to get the contained controls to show up, it looks like they are created, but I dont know know where they are. Here what I do, is there another way?
Code:
Yposition = fraComp(0).Top + fraComp(0).Height
For Index = 1 To UBound(Hostnames)
Load fraComp(Index) 'Load Control
Load picConn(Index)
Load prbRefresh(Index)
Load lblMinutes(Index)
Load txtTime(Index)
fraComp(Index).Move 0, Yposition 'Move Control
picConn(Index).Move 0, picConn(0).Top + Yposition
prbRefresh(Index).Move 0, prbRefresh(0).Top + Yposition
lblMinutes(Index).Move 0, lblMinutes(0).Top + Yposition
txtTime(Index).Move 0, txtTime(0).Top + Yposition
'fraComp(Index).Visible = True 'Show Control
picConn(Index).Visible = True
prbRefresh(Index).Visible = True
lblMinutes(Index).Visible = True
txtTime(Index).Visible = True
Yposition = Yposition + fraComp(0).Height
Next Index
Help Me For Loading An Unloading Controls Dynamically
I'm trying to create an application like EditPlus(a code editor) where the user is allowed to open multiple files...
In that process I'm stuck witha problem
I have a tab control on the form and whenever the user opens a file, a new text box gets loaded and the tab number increases. but suppose the user opens 4 files (he then has 4 tabs)...
but if he closes the second file.... I could not rearrange the 3, 4 th text boxes to 2nd and 3rd respectively, as the Index property is readonly. (Where as if a tab is removed, they rearrange themselves). How could I go about it?
Thanks
VJ
Loading Controls Dynamically - With A Twist ??!!!
OK, we know that you can load controls dynamically (either the "old" VB5 way using a dynamic control array, or the VB6 way which lets you use the Add method without the need for an intial control array element). However, is there a way to do the following?:
Let's say I have Form1, which has a TabStrip on it. Let's say I also have a couple of other forms (Form2, Form3, etc.) which will contain the set of controls required for each tab. Depending on which tab the user clicks on Form1, I want to Unload the controls on Form1, and replace them with the contents of the Form corresponding to the tab that was clicked.
I don't want to use the method of showing/hiding multiple frames on the same form (Form1) because there is simply too much - I'm dealing with 15 tabs worth of info here.
Any thoughts?
Dynamically Loading Controls Into Controls...
I haven't worked with creating my own controls much in the past, and I need a bit of help. I've made two controls, one is a kind of listbox, another is an item to populate the listbox, that can hold pictures, text, etc. My question is how would I dynamically load an item control into the list control as part of an array?
^^^ I hope that makes sense
Dynamically Adding User-created Controls To User-created Controls -- For Gurus
dear all,
i have created two UserControls, control1 and control2.
i need to have multiple instances of control2 running into control1, and i need to catch the events of these instances.
i would have, in control1, declared this:
VB Code:
Private WithEvents ctl2() As control2
unfortunately you can't declare an array with WithEvents.
I've seen a method that works by encapsulating control2 into a class, and then adding this class to a collection.
my questions are:
1. is there another / easier way to do this?...
2. how do i dynamically add control2 to control1?
VB Code:
Dim mCtl2 As control2Set mCtl2 = New control2Set mCtl2 = control1.Controls.Add("Project1.control2", "CTL_" & index)
doesn't work since .Controls is not a method of the object...
any suggestions?...
Load Controls Dynamically / Loading Objs Via CLSID
I'm trying to load controls Dynamically onto a form at runtime, the type of control is specified in a file.
for example
I have a flat file that has this data:
----------------------------------
TypeObjName=Forms.ComboBox.1
ObName=MyCombo1
Index=
Height=315
Width=1215
i can then use the CreateObject command in VB like this:
Dim iObj as Object
Set iObj = CreateObject("Forms.ComboBox.1") 'Create a vb 2.0 combobox
I get a Object created and if i use my Locals window, i Do see that there is a combobox Obj. I know it still has a long way to go before its a GUI obj. (it has No hwd, no Name, ect...)
The question is How do i get that as a GUI obj there at run time? I do NOT want "Work around" like adding a control to the form a design time & using LOAD iobj(1) and just moving the object ect... (that defeats the purpose of having it dynamic.)
At some point I would like to change the flat file around to say like this:
----------------------------------
TypeObjName=Forms.CheckBox.1
ObName=MyCombo1
Index=
Height=315
Width=1215
and just switch the type of control around......It would be really kool if i could do this with just its CLSID {8BD21D40-EC42-11CE-9E0D-00AA006002F3}. Kinda like how it's done with scripting....example of the "Microsoft ListView Control, version 6.0" obj.
<object classid="clsid:BDD1F04B-858B-11D1-B16A-00C0F0283628" id="ListView1" width="100" height="50">
So, what else needs to be done to get this a a running Obj on the GUI?
-James
VBNerd@premier1.com
Dynamically Loading ActiveX Control
Hi,
I am creating a application which require loading an component dynamically & show its icons in my toolbar. It is work same as visual basic. Laoding the OCX control & displaying all controls in toolbar.
If anybody have solution for this , please let me know
Regards
Anil Bajaj
Dynamically Add Controls To A Tab Control At Runtime
I'm trying to dynamically add a control to the SSTAB control at runtime.
The following commands add the control to the tab control, but they only put the viewport on the first tab.
ssTab.Tabs = ssTab.Tabs + 1 ' add a new tab to ssTab
ssTab.Tab = ssTab.Tabs - 1 ' make new tab the current one
Set txtNew = Controls.Ad("VB.TextBox", "Text1") ' create Text1
Set txtNew.Container = ssTab ' set the container for Text1
How do I specify which tab the textbox will appear on. It always appears on tab 0 (the first one), rather than the current one.
Adding Controls Dynamically Without A Control Array
When I add buttons dynamically to a form by using a control array, I can write code to respond to their specific click events by using the index argument i.e.
if index = 1 Then
Do something
Elseif index = 2
Do something else
etc.
But if I use the following code:
Set mcmdButton = Controls.Add("VB.CommandButton", "Button")
With mcmdButton
.Visible = True
.Caption = "Button"
'Also set location on form here
End With
inside of a procedure so that I keep adding buttons - the problem I have is that only the most recently added button will respond to a click event (assuming I also wrote a click event procedure). Is there any way around this? If not what is the benefit of this method? It would seem control arrays are better - but from what I read - this method was supposed to be an improvement over control arrays in VB6. I guess I don't understand why.
Thanks.
Removing Dynamically Added User Control Runtime
Hi .. I have made a user control with a couple of combos and labels..
I am adding a number of controls runtime.
Set Company = frmMaster.Controls.Add("Placements.Company", "S" & index, frmMaster)
where index keeps getting incremented.
When i try to remove the control runtime using ,
frmMaster.Controls.Remove "S" & index
i get the following error :
run-time error 365
Unable to unload within the context
I dont know how to go about this...
Please help me out
Present Another Form When Loading User Control
I want to do something so that when a big user control loads, another small form loads also, and the small form could be floating around with mouse drag.
same thing as toolbox appears and could be moved around when you drag the mouse when you lauch photoshop,
how to do that
thanks
Problem While Loading A User Control More Than Once At Runtme In Vb6
hi! i have a problem while loading a user control more than once at runtme in vb6. i have created a usr control having some textboxes,etc. when i load it more than once in at runtime in my form and give it a certain command they both act as same. for eg. if igive a command to a textbox in my control to change its text, then both the controls' textboxes display same text. can i change this property?????
thanks in advance. pls help me!!!
Draging A User Control Between Controls
Hello,
I can't seem to figure out how to drag a custom control (say control type A) between controls (control types B). An instance of control A starts on one of the Bs. I can drag just fine within the that B control.. but It will not drag to the other B control on the form (or anywhere else for that matter).
Any ideas how I can do this?
Thanks
User Controls And Control Arrays
Hi Friends!!
I want to deal with a control array in an user control. the code is working fine in the control level, while rendering the control in the form it is not listing the other elements in the control array. the left, top, visible, container properties assigned.
please help me to get rid of this....
thanks in advance.
Joseph Moraise
Why The Need For A User Control Encapsulating Winsock Controls ?
This is an app i downloaded form PSC, just trying to understand how it works. Its a P2P file sending app.
Well it has 2 user controls, receiver and sender both user controls have 2 winsock controls on them and both user control are placed on the main form with the receiver set to listen.
I dont understand the concept here, you could have all needed winsocks on the main form with the code in the main or split between the main and a module, whats the benefit of the user control ?
Adding Controls Via User Control Property Page
Good afternoon, im not sure if this is in the right place but im sorry if its not, what i have is a user control that i have made, and im now in the process of designing the property pages, but im having difficulty with a certain part.
What i want to do is when the user access the Property page, and inserts text into the into a text box and clicks a button, the user control will add the label there and then, for example, with the Microsft Windows Common Controls toolbar control, when you click Insert Button, its adds it automatically, or the Status Bar control, it adds it all dynamically.
I have written in functions were it does it at runtime, but it means putting all manor of code within the Form_Load() of each form were the control is present. i shall show my runtime AddItem code below
Code:
Public Sub AddItem(strLabelTitle As String, strFormName As String, _
Optional Picture As IPictureDisp)
'//Store The Information
'//In A Private Type Created Earlier (.FormTitle & .LabelTitle Are Collections)
With LinkList
.FormTitle.Add strFormName
.LabelTitle.Add strTitle
End With
'//Get the amount of items already in the list
Dim cnt As Integer
cnt = LinkList.FormTitle.Count
'//Work Out Height of User Control
'//Labels and Images Are Stacked Underneath Each other
'//This Sets the Control height
If cnt = 1 Then
Height = topImage.Height + 510
Else
Height = topImage.Height + lblCall(0).Top + CInt(cnt * 330) + 60
End If
'//Load New Versions Of The Image And Label
'//Label & Image Sit side by side in the user control
Load imgCall(cnt)
Load lblCall(cnt)
'//Set Image Properties (imgCall(0) is the one we are duplicating)
With imgCall(cnt)
If cnt = 1 Then
.Top = 120
Else
.Top = CInt(CInt(330 * CInt(cnt - 1)) + 120)
End If
.Picture = Picture
.Visible = True
.Width = 240
.Height = 240
.Left = 240
End With
'//Set Label Properties (lblCall(0) Is The One Were Duplicating)
With lblCall(cnt)
.Caption = Chr(32) & strTitle
.Visible = True
.Left = 480
'//Work Out Top Value
If cnt = 1 Then
.Top = 120
Else
.Top = CInt(CInt(330 * CInt(cnt - 1)) + 120)
End If
End With
End Sub
Can the above code be adapted in anyway so that we can add the label & images at design time. I have searched high and low on this, ive even tried to look at other toolbar source code trying to decipher this, but just cant seem to make any head way. At the moment my Form_Load() on my main form is up to 260 lines, due to adding all the information on form load.
Any Help would be most appreciated
Thank you & Kind Regards
Devon
User Control Container For Grouping Multiple Controls... Yar!
Ahoy there!
Simple one.. but problematic for me..
I need some direction regarding a control container. I'm wanting to group a number of controls together, textboxes/labels/commandbuttons/etc., in a container, so that I can hide and reveal a group of controls simultaneously and with little code. The issue is I can't use a Picturebox or a Frame, because they're not translucent. I decided that I would make a UserControl, but that flopped for some reason.. Even at design time when I place the controls into the UserControl, they become invisible, and remain that way at runtime.. I set the UserControl properties to translucent and container to accomodate.. What should I do?
Needs to be translucent, and a container... Any feedback/direction muuuuch appreciated
Loading A DLL Dynamically
If you don't know the name of the function at runtime that you need then the dll is pretty much useless to you. Though there is a way to find out all the functions in a dll (load it up in a hex editor and look towards the end of the dll).
If you want a plug-in type archetecture like netscape or ie, you need to design an interface (a blank class with all the functions you will need a dll to support compiled into a dll) that any new dll will use (implements <interface name>). This way, if you need the dll to run code that modifies something, you pass the data to a known function that is available to any dll you load.
To load a dll that you don't know about until runtime, keep an ini file, a registry setting, or some other way to store the dll names in and do something along these lines:
Code:
Dim myDLL As Object
Set myDLL = CreateObject(myDLLName & "." & myDLLObject)
I'm fully unsure if this will work, but you can give it a try
Dynamically Loading OCX Files
Hi all,
In one of my projects I have a custom OCX file I wrote. The ocx is specified in references in the main vb project.
I want to give the users the ability to disable the ocx completely (this means that the program doesn't check for the ocx at all) by using a command line option.
Is this actually possible to disable a reference to an OCX in code? Or to *not* reference the OCX in Project - References and to dynamically load it instead?
Thanks for the help!
Loading Form Dynamically
I have a string variable which contains a FORM Name. Now I wanted to load the FORM from the value in the string variable. My code is something like this...
****************************************************
Dim gForm as Form
Dim mFormName as String
mFormName = "MyForm"
Set gForm = mFormName
gForm.Show
****************************************************
I do not want to use CASE SELECT statments, becos there will be atleast 50 Forms and more when my Prj is completed. Can somebody please guide how to handle this situation.
Dynamically Loading A Datacontrol
Anybody who could tell me how can I load a datacontrol at runtime? I just dont want to put a datacontrol into my form at designtime, I want to load it at runtime, I believe it is more flexible. Or better yet, how can I populate a DBGrid without using a datacontrol, can a recordset do this? Any reply would be appreciated a lot.
Dynamically Loading DLL's From Server ?
Can someone explain to me why VB Run Time DLL's have to reside in a client's WINDOWSSYSTEM (or WINNTSYSTEM32) directory ? Isn't there a way that a client can dynamically load the DLL's from a server directory ? I thought this would prevent touching the client's machine, as in my case; I have over 70 users, and would like not to have to have the DLL's installed on each machine.
Any info on this is appreciated !
Dynamically Loading DLLs. Is It Possible?
Hi,
I was wondering.. is it possible to dynamically load an ActiveX dll programmatically? i.e. Have no reference to it in the project but still be able to load it through code?
Thanks,
Rob.
Dynamically Loading An Imagelist
I have this imagelist I fill at runtime. I load the images from bitmaps, and add them to the imagelist with the key the same as the filename. However, when I try to add a node to a treeview, and supply an image, it says 'Invalid key'
This is the code, as always, help appriciated
private Sub LoadImages()
' this is used to load the images into the imagelist
' code doesn't give an error
IL.ImageHeight = 16
IL.ImageWidth = 16
Dim strFile as string
strFile = Dir(App.Path & "images*.bmp")
Do Until strFile = ""
IL.ListImages.Add 1, strFile, LoadPicture(App.Path & "images" & strFile)
strFile = Dir
Loop
End Sub
' in the form_load event, I try to address it
private Sub Form_Load()
' fill the imagelist
LoadImages
Dim N as Node
' .... some other stuff here
Do Until rst.EOF
If IsNull(rst("objectParent")) then
' add root element to the treeview
set N = TV.Nodes.Add(, , "OBJ" & rst("ObjectID"))
else
' add child to the treeview
set N = TV.Nodes.Add("OBJ" & rst("objectParent"), tvwChild, "OBJ" & rst("ObjectId"))
End If
' set the text
N.Text = rst("typename") & ": " & rst("objectname")
If Not (IsNull(rst("typeimage"))) then
' set the image
N.Image = rst("typeimage") '*** here it goes wrong
'*** rst("typeimage") is a string and has a valid value
End If
rst.MoveNext
Loop
End Sub
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Loading A Movie (jpg) In Flash Dynamically
I have a flash movie that plays in my visual basic program (using the Flash.ocx).
I want to have it dynamically load a jpg into a movieclip but can't seem to get it to work.
This is what I tried first:
Code:
swf1.LoadMovie "_root.graphicMov", graphicFolder & frmExamEditor.txtGraphic.Text
but it wouldn't work.
So I set up code on the mc to do an onClipEvent(enterFrame) like this:
onClipEvent(enterFrame) {
if (_root.graphic <> oldGraphic) {
this.showGraphic.loadMovie(_root.graphic);
oldGraphic = _root.graphic;
}
}
I set the oldGraphic = "" and the _root.graphic = "" when it starts up and then used this vb code to set the _root.graphic variable:
Code:
swf1.SetVariable "_root.graphic", graphicFolder & txtGraphic.Text
That wasn't working so I put in a dynamic text field to show the _root.graphic variable and its passing the path and imagename correctly (
D:GraphicsCSO_Test1 estGraphic.jpg)
Anyone have any idea why the flash file won't load the jpg in?
Dynamically Loading A DataCombo Box List
What is the use of having a DataCombo if the list is blank? I know I can add manuallly using the ListField but I want to be able to pull all of the Cities that are in the database into the Combo Box pull down list. It seems I should be able to but I am having the hardest time finding a book that tells me how.
Properties of DataCombo1:
Name DataCombo1
DataField stu_city
DataSourceAdodc1
ListField(None)
RoawSourceAdodc1
Text DataCombo1
Crystal And Loading Picture Dynamically
Hello all
It's been a while since I visited and I am impressed with the new look!
I am having a problem with crystal reports (V7). I am running reports from vb6 using CREPAuto as shown below and I am having a problem trying to create an image in a report when it is being printed. I have tried inserting an image in the report as an OleObject and then setting its properties but this did not work either. Here's the code for CreatePictureObject,which gives an error 30017 'Feature Not Enabled'. I have tried using the line;
Code:
app.EnableFeatures()
but it requires a 'Key As String' parameter and I am not sure what the key is! I have searched the developers help but I am going around in circles at the moment.
Any help would be appreciated.
Module Code;
Code:
Private repView As CRPEAuto.View
Private WithEvents rptReport As CRPEAuto.Report
Private rptSection As CRPEAuto.Section
Private rptOle As CRPEAuto.OLEObject
Private WithEvents wndReport As Window
In an Image_Click event I create a recordset which is then passed to the report object as follows;
Code:
If rsReport.RecordCount > 0 Then
rsReport.MoveLast
rsReport.MoveFirst
Set app = CreateObject("Crystal.CRPE.Application")
Set rptReport = app.OpenReport(strReportLocation)
Set reportDb = rptReport.Database
Set reportTables = reportDb.Tables
Set reportTable = reportTables.Item(1)
reportTable.SetPrivateData 3, rsReport
Set rptSection = rptReport.Sections(3)
strPartImagePath = (strNetPath & "images" & rsReport.Fields("ImagePath1"))
rptSection.CreatePictureObject strPartImagePath
Set repView = rptReport.Preview("Route 1")
Else
MsgBox "There are no route entries to print."
GoTo Image2_Click_Exit
End If
MSFlexGrid Loading Headers Dynamically
I need to by able to load headers from an MSAccess database table into an MSFlexGrid. The problem is that I need to load these headers dynamically as I never know the number of headers.
Anyone?....anyone?.....
Loading Picure Dynamically In Datareport
Hi guys,
Can anyone tell me how to load picture dynamically in datareport rptimage control...b'coz when I am writing the below given code it gives me an error:.........."Object doesnt support this property or method"........my code is:
Dim rsImage As New ADODB.Recordset
Con.Open "database"
Set rsImage = Con.Execute("select * from Remarks where PatientID=1")
With PicDet
Set .DataSource = rsImage
.Sections(3).Controls(1).Picture = LoadPicture(rsImage("image"))
End With
PicDet.Show
PicDet.Refresh
rsImage.Close
Con.Close
rsImage("image") contains image path like this "C:img.gif"
Tx in advance
Dynamically Loading & Evaluating Formulas ...
hi,
i'm developing an application for a client to do the following things:
A welding company wants to calculate some OUTPUTS based on some inputs using some formulas. There are 20 to 30 different welding designs -- each design has a different formula to calculate its WeldWeight. This weld weight has to be calculated before any of the other formulas are evaluated ...
The problem is that the company will/might add more designs, which will have their own WeldWeight Formula. This obviously means that the info about the designs would need to be dynamically loaded into the program and calculated dynamically ...
Does any one have any ideas -- i've attached a DOC that outlines the type of formulas that have to be calculated ....
Edited by - snigger on 4/10/2004 9:45:24 PM
Loading Text Dynamically Unto A Page
Hi guys,
Im building an HTML page of an associate members of a law firm. i create image thumbnails of them in 4 by 5 table. anytime i click on an image thumbnail i want their history file to be loaded into the adjacent column of the table. each associate member have a text file as their history file and it is the information from this text file i wanted loaded unto the adjacent column on the page. pls how do i go about it.
Thanks
Dynamically Loading Dlls At RunTime
Is there any way that a I can load a given DLL and declare a function at run time? The user would select a DLL, then type in the name of a function to call within that DLL.
For example, could something like this be declared at runtime:
NewDll = "advapi32.dll"
NewFunction = "RegCreateKey"
Declare Function NewFunction Lib NewDll (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
1) Is it possible?
2) If so, are there any samples to get me started?
Thanks,
AC
Loading A "User Control" From Within An ActiveX EXE
After a while of attempts, alot of errors and web searching I have brought myself to asking on the forum to see if anyone has done this.
First: The application has a plugin style foundation, so there is a primary EXE that handles the loading of any plugin's it locates. This is all running smooth however now I am trying to get one of the ActiveX exe plugin's to handle the functionality of being able to alter the main display form. In theory, the main application will communicate with the plugin the location of where certain regions are and the plugin will position the "User Control" accordingly. Seems any attempt I have made has either ended with "Object required" or Cannot create errors.
Thank you
Loading Picture In Data Report Dynamically
Hello all,
I have the data from Access Database to the data report based on which ID the user clicks on the form already. Now my problem is that I made only one data report for my many different reports.
I wanted to put the picture corresponding to each report. In order to do that, I must some how load the picture dynamically in data report.
Is there an easy way to do this? I would really appreciate any help.
Thanks in advance.
kol
N00b Question - Sorry In Advance! {Loading Picture Dynamically}
It's 2.50am here and I've been awake for 18 hours, so I'm starting to struggle a little, but I really want to get a particular piece of code finished before I head to bed.
On the load of a form, I'm checking if an option in a database is 1 or 0 and if it's 1, load 2 images from external files into an imagebox, then make them and a label visible. If it's 0, do nothing with them. Don't load the images, don't make anything visible.
The files are to be stored in app.pathLogosxxxx and are named 1.gif and 2.gif. xxxx is a 4 digit year such as 1903, but I'm retreiving this year from a string named WhichYear stored on a form named MLB, so it's MLB.WhichYear.
Now, I'm having trouble getting it to load the image. The code I'm using is:
Code:
img1.Picture = App.Path & "logos" & MLB.WhichYear & "1.gif"
Whenever I run it, I get a type mismatch on the second ampersand. Maybe it's just my brain shutting don for the night, but I don't see why.
Really just throwing it out to see if anyone else can see a problem with the line. If anyone does know, I would really appreciate it if you would reply ASAP, because I really have to get to bed as soon as this is done. Early start tomorrow.
Thanks in advance, and apologies for cluttering up the forum with a question that will probably be glaringly obvious to anyone who is more than 50% awake.
Loading Activex Usercontrol Dynamically On To Access Form
Hi,
I'm having problems with some lost events in Access 2000 and a usercontrol I've made in VB6. I found an article at www.exceletel.com/support/DevEnv/Access where they recommended loading activex dynamically to get around the Access ActiveX Wrapper.
I tested this in the forms code:
Public WithEvents mpBox as Map.MapBox
I get access to all the properties and events that were not visible when I added the usercontrol by dropping it on the form. However, I can't figure out how to put the dynamically loaded control on to the form. There is no .top or .left properties for instance. (I tried: set mpBox as New Map.MapBox but Map.MapBox is not available when you use New)
Can you give me some advise?
Dynamically Add Controls
How can i add controls like lable,text box run time in vb 6.0
I dony want anything at design time.
Dynamically Creating Controls??
hi there
I want to Dynamically create a control instead on having it on my form.
Code:
Dim X, Y, A As Integer
Dim obj As ListImage
Dim Storage1 As Picture
PlayersID = 1
Tiles.Picture = LoadPicture("Tiles1.bmp")
MapList.ListImages.Clear
TempName = "Tiles1" 'ExtractName(CommonDialog1.FileName)
For Y = 0 To Tiles.ScaleHeight - TileDim Step TileDim
For X = 0 To Tiles.ScaleWidth - TileDim Step TileDim
storage1.Cls
BitBlt storage1.hdc, 0, 0, TileDim, TileDim, Tiles.hdc, X, Y, SRCCOPY
Set obj = MapList.ListImages.Add(, , storage1.Image)
Set obj = Nothing
Next X
Next Y
I get run time error '91'
object variable or with block variable not set.
how can i fix this??
Dynamically Selecting The Controls
ok guys im rather new to vb and dont know really how to word my problem but here goes,
ive got a load of labels, lbl_book_1, lbl_book_2, lbl_book_3......and so no til lbl_book_16
now the problem is is i want to select these labels during a count controlled loop and put some text in them, the lebel i want to select corresponds to the loop counter so when number = 5 i want to select the label lbl_book_5
Code:
number = 1
do until number = 17
(name of selected label).caption = "blah blah blah"
number = number + 1
loop
i hope you guys sort of get the idea to my problem, thanks
Dynamically Created Controls
I use the new new keyword to create an instance of some visual control. Now the problem is I don't quite understand how to redefine its event handlers (for eg. a click method) There's obviously little use of a button if can do nothing....any suggestions?
Dynamically Created Controls
How do you place one dynamically created control inside another?
Specifically I would like to place a Label inside a PictureBox or a Textbox
(with the Label being on top and visible).
I'm thinking I need to use the Container property somehow, but all
my attempts have failed.
Dynamically Add C++ Controls To A VB6Form
Hi,
I am trying to dynamically add a control built by C++ to a VB6 Form by VBControlExtender. However it is crashing my program and do not give any error message.
Any idea?
Thanks,
Winnie
How To Dynamically Add Controls To A Usercontrol
hi,
i am using vb6. i wish to create a ocx keyboard.
my keyboard buttons will be made up of image controls.
the number of image controls to be added to the usercontrol will depends on an external xml file.
furthermore, for each buttons clicked, there shoud be a corresponding event fired.
can you please teach me how to go about doing this.
thanks.
Adding Controls Dynamically
Hi all
I am using data report in my project. I want to add the controls to the report at the run time. Kindly tell me how can this be achieved?
Thanks in advance
Regards
Moving Controls Dynamically
Hi,
I have a set of checkboxes, each with hidden, related textboxes and radio buttons under them. When a checkbox is clicked, the hidden textbox and radio buttons appear under it, and depending on the option selected, another textbox may appear below the first.
The problem is that the textbox/radio buttons appear over the next checkboxes and other controls.
How can I make all the controls (below the selected checkbox and it's related textbox/radio buttons) move down when a hidden textbox becomes visible, and move back up when the checkbox is deselected?
Thanks in advance for any help.
'enzy
|