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




Loading And Unloading In A Label Control Array


This is the program that I am trying to duplicate. The problem that I am having is the loading and unloading of the labels in the control array when the vsb's are clicked. The .visible property is not an option as i have to load and unload the labels. I got them to load properly in the form initialization but when i try to load or unload them it says that The object is already loaded. The program is trying to load all of the instances of the label again instead of just adding new ones.

This is the code that im working with:

Private Sub addandsubtract()

Dim mintLeft As Single
Dim mintTop As Single
Dim mintWidth As Single
Dim mintHeigt As Single
Dim i As Integer

mintLeft = lblPixel(0).Left 'Define and position the controls.
mintTop = lblPixel(i).Top
mintWidth = lblPixel(i).Width
mintHeigt = lblPixel(i).Height


For i = 1 To vsbHeight.Value * vsbWidth.Value - 1 'Create the controls.
Load lblPixel(i)
If i Mod vsbWidth.Value = 0 Then
mintLeft = lblPixel(0).Left 'Start a new row.
mintTop = mintTop + mintHeigt
Else
mintLeft = mintLeft + mintWidth
End If
lblPixel(i).Move mintLeft, mintTop, mintWidth, mintHeigt
lblPixel(i).Visible = True
lblPixel(i).Caption = i
Next i

lblPixel(0).Caption = "0"

End Sub

Any Help would be much appreciated

Thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading/unloading Objects In A Control Array
I have a control array of shapes using another array as a sort of point to another piece of information.

I use a counter to tell the Control array to
Load Shape(counter)

The problem is that when I unload a shape, the counter decriments, and when I want to load a new Shape, it tries to load a shape that already exists.

Is there a way to Fill in any gaps in the Control Array at runtime? I already have 4 or 5 pointers and functions pointing around, I don't want to have to throw a stack in the mix as well.

Thanks in advance

Unloading And Loading A Control.
I have a TreeView control on my form and I wish to completely unload it from memory and and place a new TreeView control in its place (With the same name). The unload command does not apply here from what I've seen. How would I got about accomplishing this?

Unloading And Loading A Tree View Control.
I have a TreeView control on my form and I wish to completely unload it from memory and and place a new TreeView control in its place (With the same name). The unload command does not apply here from what I've seen. How would I got about accomplishing this?

Unloading An Object From A Control Array
I have a control array adding imageboxes at runtime, I want to be able to remove the selected object.


Code:
Private Sub mnuremove_Click()
If imgobjects(Index).BorderStyle = 1 Then
Unload imgobjects(Index)
ElseIf imgobjects1(Index).BorderStyle = 1 Then
Unload imgobjects1(Index)
End If
End Sub

Basically, when you click on an object, it changes the borderstyle to 1, so this checks to see which object is selected. I have two control arrays, thus the reason from imgobjects and imgobjects1

I don't see why it won't unload.....

Unloading Shape Control Array
I have a control array of Shape1(0)

When a command button is clicked it loads the next Shape1(1) and so on.

How do I unload these shapes, ive tried unload (Shape1(1)) but soesnt work

Thanks

Unloading A Control Array From Picturebox
Hi,

I am trying to unload a textbox control array from a picturebox and I keep getting the following error message:

"Unable to unload within this context".

I have a function that I check to see if the control is loaded...if it is loaded that is when I try to unload it but get the above error.

Thanks,
Blake

Control Array: Problem In Unloading
I am trying to load a control array of a text box, in a combo box click event. The next time the user click on the other item of combo box, I want to unload the control array and freshly load again. But its somehow not working. When I am trying to unload the text boxes added at run time(in control array), I am getting a run time error, saying, "UNABLE TO UNLOAD IN THIS CONTEXT". I am curious to know why is this happening.
I went through the help for that run time error, it says , there should be some 'Unload' statement, in other events, thats preventing me to unload. But I do not find any unload statement in any of the events of that particular combo box.
Could anyone tell me why is it happening?
Thanks...
Rashmi.

Control Array: Problem In Unloading
I am trying to load a control array of a text box, in a combo box click event. The next time the user click on the other item of combo box, I want to unload the control array and freshly load again. But its somehow not working. When I am trying to unload the text boxes added at run time(in control array), I am getting a run time error, saying, "UNABLE TO UNLOAD IN THIS CONTEXT". I am curious to know why is this happening.
I went through the help for that run time error, it says , there should be some 'Unload' statement, in other events, thats preventing me to unload. But I do not find any unload statement in any of the events of that particular combo box.
Could anyone tell me why is it happening?
Thanks...
Rashmi.

Problem Unloading Controls Ina Control Array!?!
I have the following code which I need to unload all but the first controls (0) in 3 arrays:


Code:
Y = 0
Do Until Y = Ttl
Y = Y + 1
Unload shpResult(Y)
Unload lblResult(Y)
Unload lblTestInfo(Y)
Loop
All I got in response is an error #365 :- "Cannot unload in this context".

I also tried this (thinking you might only be able to unload the last control each time):

Code:
Y = Ttl
Do Until Y = 1
Y = Y - 1
Unload shpResult(Y)
Unload lblResult(Y)
Unload lblTestInfo(Y)
Loop
...and it still had the same error!?!

Firstly, what does the error message actually mean? ...and secondly, what is the right context to use?

Thank you in advance!
(Sorry if this has been asked/resolved already...couldn't find anything...)

How To Perform A Check In Unloading A Control Array
I have the following code:
Private Sub picid_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)

NewX = picid(Index).Left + X (Line1)
NewY = picid(Index).Top + Y (Line2)

Dim I As Integer (Line3)

For I = MAX_SHAPE To 1 Step -1 (Line4)

If (picid(I).Visible = True) And _ (Line5)
(NewX > picid(I).Left) And (NewX < picid(I).Left + picid(I).Width) _
And (NewY > picid(I).Top) And (NewY < picid(I).Top + picid(I).Height) Then

DRAGGED_SHAPE = I

If SELECTED_SHAPE <> I Then
PREV_SELECTED_SHAPE = SELECTED_SHAPE
SELECTED_SHAPE = I
End If

distX = NewX - picid(I).Left
distY = NewY - picid(I).Top

Exit For

End If

Next I

End Sub

The problem in working the code above is that in another place (not within the code above) I have dynamically declared a control array picid(I) using the "load" statement. Once I no longer needed a particular control array element, I unloaded it using "unload". However since the above code requires to loop through every control array element (Line 5), thus when it reaches the control array element which has already been unloaded it generates an error. I need to know if there is some way to put a check for an element of control array, whether it is unloaded. If it is unloaded then the loop will be skiped.

Unloading Array Controls In Control's Event
Hi,

I'm having this problem with unloading array controls in a control's event (e.g. ComboBox CLICK() event).


Code:

Public Sub Combo1_Click()

Dim i As Integer

For i = Text1.UBOUND To 1 Step -1
Unload obj(i)
Next i

End Sub


It gives error 365 "Unable to unload object within this context". I've checked through and understands that in a few controls events, you can't load or unload controls.

But I need to do it in the control's click event:
My situation is this:
I have a combo box which when the selection changes (CLICK), it will load the controls accordingly. Some selection may load 1 or more TextBox or none.

I can do it under Key_Up() event, but can't do it in Click() event. Well, i can't always just depends on the Key_Up() event. I could create another button to do it but it's inefficient.

I don't understand why does it not allow us to load or unload the controls in those few events... Is there any way to do it? API?

Thanks in advance...

P/S: I've read a post by someone where using timer to do it, I haven't tried it, tough the logic is there, but I still think it's not efficient. Tough, it's one way to do it... currently..

Unloading Control Array Objects During A Form Resize
You really don't want to know why I want to know how to do this... but,

I need to unload a lot of labels from a control array upon form resize. The alternative is to get into a horrible situation making them visible or invisible and updating lots of information in them. There's also a scroll bar that I can see is just waiting to foul things up if I take this route.

Any way that I can fire off an event from the form resize after I've exited it?

-Thanks.

Label COntrol Array
Hello, I am having a problem with a control array of labels I get this error

Runtime error 6

Overflow

Here is my code.


VB Code:
sqlRec.Close sqlRec.Open "SELECT * FROM ibf_members", sqlCon, adOpenDynamic, adLockOptimistic Do Until sqlRec.EOF = True Load frmMembers.lblUser(frmMembers.lblUser.UBound + 1) frmMembers.lblUser(frmMembers.lblUser.UBound).Caption = (sqlRec("name")) frmMembers.lblUser(frmMembers.lblUser.UBound).Top = frmMembers.lblUser(frmMembers.lblUser.UBound - 1).Top + frmMembers.lblUser(frmMembers.lblUser.UBound - 1).Height frmMembers.lblUser(frmMembers.lblUser.UBound).Left = frmMembers.lblUser(frmMembers.lblUser.UBound - 1).Left Loop


Also it highlights this line when the error is shown.

Load frmMembers.lblUser(frmMembers.lblUser.UBound + 1)

Control Array (label)
Can i change the caption of all the labels which i have declared as a control array?

I tried label1.item.caption="Change all same"
but the error msg "number of arguments not correct" came up.

Does this means i have to resort to having a loop?

Array Of Label Control As Parameter
Hi! I have a array of label controls eg: lblMenu(14)

I need to call a routine by passing this label contrl eg: SetMenuItems lblMenu
and at routine I need this label as parameter eg: private sub SetMenuItems( theMenu() as Label) , so that I could check my array labels in that routine as below
           for cnt = 0 to themenu.ubound
                .... do something
           next

   It gives error in the routine it doesn't take it as array... what is wrong with my code. How do I do that.

Thanks & Regards
JK

Loading Control Array
Hi there!

I'm working on loading a form dynamically based on information I get from a database.

I receive from the database a number of option buttons to load, which I store in arrButtonCount.

I have a series of six option buttons on my form -- opt1(0), opt2(0) . . . up to opt6(0).

I'd like to say to loop through the number of required option buttons, each time loading the next option button.

Only I can't figure a better way to do this other than the cheesy "If counter = 1 then load opt1(i)"

Does anyone have a better way to do this??

For i = 1 To UBound(arrHeading)
For Counter = 1 To arrButtonCount(i)
If Counter = 1 Then
Load opt1(i)
Set optname = opt1(i)
ElseIf Counter = 2 Then
Load opt2(i)
Set optname = opt2(i)
ElseIf Counter = 3 Then
Load opt3(i)
Set optname = opt3(i)
ElseIf Counter = 4 Then
Load opt4(i)
Set optname = opt4(i)
ElseIf Counter = 5 Then
Load opt5(i)
Set optname = opt5(i)
ElseIf Counter = 6 Then
Load opt6(i)
Set optname = opt6(i)
End If
With optname
.Visible = True
End With
Set optname.Container = fraAIE(i)
Next Counter
Next i

Loading 2D Control Array
Hi,
I've written a sub to load a 2D control array of text boxes, but I get the error "object variable or with block variable not set" when I run the program. I need help finding what might be wrong.
Thank you,

Linette

Send Label(Control Array) To Function
Hi..
Friends i need to know how to send an label which is an control array to a function..
rgs
ravi

Declaring A Label Control Array At Runtime.
The problem I have is that I want to add 25 labels to a form, and I want to do that using only code and declaring a control array. Can this be done? If so How? I have declared an array called Label(24) but when I use the For Next loop to assign values to the array, the SET statement is nested in the For Next loop, but there is always an error whenever I try to execute the statement.

The SET statement looks like this:

Set Label(intCounter) = Form1.Controls.Add("Label", "lblDynamic" & intCounter)

and the error issued is:

Run-time error '711':

Invalid class string.
Looking for object with ProgID: Label

Furthermore there is no help topic associated with the error in MSDN so I am stuck. I will be very grateful if you can tell me how to declare and add 25 Labels using a control array, during runtime.

Thank you in advance.

Create A New Control Array Of A Picture Box And A Label
hi there. i would want to create a new control array of picture box and a label.but the label should be inside the pic box. the problem is that when i create a new control array both, the label won't appear inside the pic box. the example is attached here.

Loading A .txt File Into A Control Array
hello,
I have another problem with my game. i need to load a txt file into a control array when the user clicks resign.
for some reason, when its compiled it states that method or data member not found. I have declered the variable sLetter, and this is the one that it cant find......help its driving me mad.
thanks to anyone who sends a reply.

Code:
Private Sub cmdResign_Click()
Dim sLetter As String
Dim iAcross, iDown As Integer

Open App.Path & "puzzle1.txt" For Output As #1
Input #1, sLetter
For i = 1 To sLetter
Input #1, txtLetter(i).sLetter, txtLetter(i).iAcross, txtLetter(i).iDown
txtLetter.AddItem txtLetter(i).sLetter
Next i
Close #1
End Sub

Loading Next Control Array Element
sorry if this has been posted before but im unsure on how to do this:


Code:
Dim numberofentrysubmenuname As Integer

For counter = 1 To menuentrynumbers

subnumbermenuentryname = InputBox("Enter the NUMBER of SUB MENU items in the " & UCase(txtField(counter).Text) & " Menu Header", "Sub Menu Items", 0)


'Create number of text boxes for the number of sub menu in the particular field
For tempcounter = 1 To subnumbermenuentryname

Load txtField(tempcounter + 1)
txtField(counter).Visible = True
txtField(counter).Enabled = False
txtField(counter).Left = txtField(counter - 1).Left + txtField(counter - 1).Height

Next tempcounter
'..
'..
basically it wont create the txtField(tempcounter + 1)


how can i add the txtField on the form by adding one more to the value of the counter? because it keeps saying control array loaded already or the object already loaded

many thanks

Label Control Array Manipulation (Deadline Approaching!!!)
ok... i have a question as to controlling a control array at runtime. The array Label1 is declared as a control array of labels at design time. I want to be able to redim the size of that array and manipulate the Label1(i) objects in the array at runtime. Also, I want to be able to hide and show different labels, in a grouping of ten, of an array with more than ten labels.

So... is it possible to declare a control array at design time and then expand/contract it at run time as i wish? (This is all based on how much data is drawn from a database, by the way...)

I tried doing this using my basic knowledge of VB and when I put the code
ReDim Preserve Label1(size + 1)
when i wanted to add a label to the control array, I got an undeclared variable error. I'm assuming this is because locally, in the Form.Load() procedure, Label1 does not exist, but I'm not sure if there is a way around that... ideas?

-365E

Error :7 While Loading Control Array Of Textbox (more Than 800)
Hi,
This application is about calculation of flatness error of surface plates. some thing related to Metrology (A mechanical subject).

In this calculation a surface plate which may go up to dimension 10m X 4m is divided in to grids of 100mm X 100 mm.The flat ness error of each grid is measured by some measurement instrument and then the array of data undergoes some internal calculation.

So the grids are to be visible for user entry.

The values from the textboxes are presently stored in an array.


In my project I have to create a control array of text box depending upon the user requirement. This will load the text boxes like a table. i.e; if user enters 40 rows & 20 columns the appl. will load 800 text boxes in 40X20 grid.

This works fine if the no. is with in 800. when the number exceed 800 , insufficient memory problem arises.

In real requirements the no. may go beyond 40,000.

What will be a better approach to solve this problem ?
if you suggest to replace the control array with a grid control.........

My Requirement :

1) Grids should be editable on run time.
2) Each grid should be filled in i.e; Mandatory.
This should be checked on exit from the grid.


Which grid control should be used for this purpose ?




Jyotiraditya Rath

http://myvbhome.tripod.com

Loading/Unloading
My program has transperancy and i want like a check box in options saying enable transperancy.How do i make it if its checked or not checked to open the same way every time?

Unloading And Loading
How Do I unload and app and then I want to load the aplication againg. I developed and multi-enterprise app and and I need to change between them.
Thanks...

Loading Unloading Forms
Hello!

I've been working on a basic VisualBasic 6 Cash Register program.

When a user launches the register form, I want to ensure that there is an active cash drawer. I have a variable CDID (CashDrawerID) that is set when the user cashes in. If the CDID = 0 I don't want the Cash Register form to launch. So I used this:

If CDID = 0 Then
MsgBox "No Drawer Open!"
Unload Me
End If

The problem is, I have a "Control Panel" form with 4 buttons, one of them is to start the register:

Private Sub Command1_Click()
frmRegister.Show
End Sub

Of course, when the frmRegister is unloaded due to a missing CDID, I get an error from the Control Panel form, because frmRegister was unloaded.

I guess I'm missing the way that the loading forms and unloading forms work.

What's the best way to remove, but to stll have access to it when you're ready for it. Wouldn't Unload be best for memory use?

Thanks for your help!!!

Unloading And Loading Forms
Hi folks,

I have this problem. I want to unload a form1 and then load Form2. On Form2 I want to unload it again to load Form1.

When i use my menuitem to unload the form everything works perfectly. When the user pressed the cross button to exit from the form it can't be loaded again. How can i make it work like my menu item?


Code:
Private Sub mAfsluiten_Click()
Unload Me
Menu.show vbModal
End Sub
the correct working way but I can't get the cross to work :S

Form Loading/unloading
Hi, I´m having some problems while loading some forms in my VBA application. The problem is that whenever I load two different forms at different times, from the main form (Application window) the second time I open the same form the application freezes displaying the form window with a blank white background.
After that I have to use the task manager to close the application..

The code I´m using on the main form is:


Code:
Me.Hide
frmSecond.Show
Then I have a return command button on the "Second" form:


Code:
Me.Hide
frmMain.Show
I´ve also tried to use this:


Code:
Unload Me
frmSecond.Show
But it seems to get the application even more unstable while switching trough forms. Am I doing something wrong and is there a better way to load/unload forms ?

Thank you!

Unloading Form While Loading...
Hello!

I have a main form and another form.

Now in main form user clicks on a button which takes him to a form called frmHoho.

Now in frmHoho's Load event there's a check like:

If DatabaseExist = False then Unload Me

Now when ever the form unloads it gives a error:

Runtime Error '364':

Object was unloaded

How to resolve this problem..i mean...how can i unload the form during load.

Thanks!

Form Loading And Unloading
I am creating an application that uses several forms. My question is, would it be better to create all the forms at the initial start of the program and then hide each form that is not being used and then unload all the forms once the application is terminated? or would it be better to load each form as needed and then unload the form when the form is no longer in use? Are there any advantages or disadvantages to either method?

Loading/unloading Or Hiding
hey guys.
I am confused.

ok basically I unload a form, and show another form2. from form2 if there is an error it goes back to form1, but it says its "unloaded'.

I even put


VB Code:
Form9.HideLoad frmSplashfrmSplash.Show


and when i press debug it highights the LOAD line.

I could use hide/show but when i show it again, the 'form' isnt started all over it. i want to start Form_load event over it

how can i fix this.

Unloading A Form While Loading
I have forms in my application..While loading a form..i checked fr some parameters..if they are not provided i pop up a window to the user..how ever what i want is to unlaod that form and display a message to the user..can any one tell me about that..thanx

Loading And Unloading Forms?
Any one have any advice on Loading and Unloading VB Forms?Sometimes a form may take a few seconds to load while establishing a database connection or loading controls

Loading && Unloading Forms
Hello
when i unload a form, what happens to its variables, are they sent into oblivion or are they set to their initial values.

if i were to load, unload and then load the form, are the values set to their initial values as indicated in the load method or do they retain any values attained in between

Loading && Unloading Forms
I know this is a reeeeaaaally basic question and probably sounds stupid, but here it goes. I've designed an application that runs from one VB form. I have an About menu that brings of a splash screen. When the user clicks the About menu option from the main form, I want the splash screen to load and the main form hidden.


Wouldn't I just do something like this in the About menu click_event?:

frmMain.hide
frmSplash.load

These aren't working for me. What's wrong??

Thanks!!

Form Loading/unloading In VB.NET
ok..it got weird. as far as i know, i have to define a variable to hold the form, then call the Form.Show.

so

Dim F as New frmMain
F.Show

but since it's Dim, does the form die once the procedure is over? That would be a bit useless...

And how do i terminate the form? (ie: replacement ofr Unload frmMain)

thanks

-C

Loading/Unloading Forms
Is it just me, or has anyone else had this problem .....

When I am in debug mode, stepping thru code with F8, if I hit a line of code that loads & shows a new form the debug stops !

Also sometimes, when I put a break in, if I press F5 half my code doesn't execute. I end up in situations where the right form is on the screen, but no code has been executed to populate my textboxes etc.

I have code that switches from screen 1 to screen 2. When the user presses a button that switches back to screen 1, it runs the code in 'Form Activate', which ends up with some text variables being empty, but if I run in debug they are not !!!!?!?!?!!

I am accessing RMS files across a network, so it could well be down to some sort of timing problem !?!!

I hope I have explained myself enough, and someone can let me know why this happens, because trying to trap this problem is proving difficult.

Thanks a lot.

Loading And Unloading ActiveX DLL's
OK, I wonder if any of you clever peeps can throw some light on this idea I have please.

It is my intention to have a "manager" app that will load (and unload) other smaller "plug-in" apps as and when the user requires them. This will enable me to issue the "plug-in" apps on an ongoing basis. I would rather the app not load ALL possible plug-ins at loadtime to save on resources.

I chose to use .DLL's over .EXE's as I hoped that the use of .DLL's would allow me to share common functions and data between the "manager" and "plug-in" apps.

Should I expect this to be acheivable in VB6?

I have tried to load (and unload) very simple ActiveX DLL's from my "manager" VB app to no avail I have looked around these forums and elsewhere and I am using the loadlibrary function from Kernel32 but whenever I try to access the DLL functions I get the "Cannot find entry point".

How should I load(& unload) the ActiveX DLL's and how should I call functions in those ActiveX DLL's from within VB?

Any help/pointers would be very much appreciated.

Many thanks
Ever so slightly Confused

Loading And Unloading Forms
I have a vb6 app that has dozens of forms.
I am experiencing an problem where I finish the code on one form,

unload formA and formB.show

I am seeing where if the unload and show are in an if statement, then I will go to the new form and when it gets to the end of the load routine, the code will take me back to the previous forms if statement.

Why is this happening and how do I avoid it?

I am wondering if I need an Exit Sub after each form.show line.

I've pasted all of the code from one test and the problem is at the very last sub routine (I think)

all code follows...

Option Explicit
Private iPassCount As Integer
Private bPassOn As Boolean
Private bFailed As Boolean
Private bPassed As Boolean
Private bFailButtonOff As Boolean
Private iStatustemp As Integer

Private Sub PassTest()

If bPassed = True Then Exit Sub
bPassed = True
SoundHorn
tmrSequence.Enabled = True

End Sub
Private Sub cmdCanBusDebug_Click()

frmCanDebug.Show

End Sub
Private Sub FailTest()

If bFailed = True Then Exit Sub
SoundHorn
bFailed = True
' Capture Failure Code
If Len(sFailCodes) > 0 Then
sFailCodes = sFailCodes & "F10" & ","
Else
sFailCodes = "F10" & ","
End If
tmrSequence.Enabled = True

End Sub

Private Sub cmdTestHelp_Click()

txtHelp.Visible = True
lblHelp.Visible = True
FindHelp ("HazardSwitch")
txtHelp.Text = sHelpText

End Sub

Private Sub Form_Load()

frmMain.Enabled = False
frmHazardSwitch.Top = SCREEN_TOP
frmHazardSwitch.Left = SCREEN_LEFT
frmHazardSwitch.Height = SCREEN_HEIGHT
frmHazardSwitch.Width = SCREEN_WIDTH

tmrSequence.Enabled = False
tmrSequence.Interval = SEQUENCE_TIME
cmdCanBusDebug.Enabled = False
iPassCount = 0
bPassOn = False
txtMessage.BackColor = vbRed
txtMessage.Text = "OFF"
SendDpidRequest
tmrScreenRefresh.Enabled = True
frmHazardSwitch.Show
frmHazardSwitch.SetFocus
frmHazardSwitch.KeyPreview = True
txtHelp.Visible = False
lblHelp.Visible = False
bFailed = False
bPassed = False
bPassOn = False
bFailButtonOff = False
bDebugMode = False

sTestAborted = "HazrdSw"

DoTest

End Sub
Private Sub SendDpidRequest()

NeoVITransmit "244", 1, 8, "03", "AA", "04", "03", "00", "00", "00", "00"

End Sub

Private Sub DoTest()

If bDebugMode = True Then Exit Sub

iStatustemp = (ReadByte("544", 1, "3", 3))

If iStatustemp = 0 Then SendDpidRequest

If BitTestA(iStatustemp, 2) = True Then iPassCount = iPassCount + 1

If iPassCount >= 2 Then

bPassOn = True
txtMessage.BackColor = vbGreen
txtMessage.Text = "ON"

End If

If (bPassOn = True) And (BitTestA(iStatustemp, 2) = False) Then PassTest

tmrScreenRefresh.Enabled = True

End Sub

Private Sub tmrScreenRefresh_Timer()

HolderQuickCheck

tmrScreenRefresh.Enabled = False

If bTesterFaulted = True Then

tmrSequence.Enabled = False
Unload frmHazardSwitch
EndCurrentTest

Exit Sub

End If

If sCurrentUser = "Engineer" Then

cmdCanBusDebug.Enabled = True

Else

cmdCanBusDebug.Enabled = False

End If

If bDebugMode = True Then Exit Sub

If frmMain.EnetOpto.InputStatus(15) = False Then bFailButtonOff = True
If (bFailButtonOff = True) And (frmMain.EnetOpto.InputStatus(15) = True) Then FailTest

DoTest

End Sub

Private Sub tmrSequence_Timer()

tmrScreenRefresh.Enabled = False

tmrSequence.Enabled = False

'NeoVITransmit "244", 1, 8, "04", "AA", "00", "03", "00", "00", "00", "00"
NeoVITransmit "244", 1, 8, "03", "AA", "00", "03", "00", "00", "00", "00"

PrepC68 'GMLan Commands Sent to C68 Controller to get ready for C68 Door Test

Unload frmHazardSwitch

If

Loading And Unloading Form In Vb.net
hi to all,

how to load ang unload for in vb.net

ex. in VB6 code

unload form1
form2.show

how to use this code in VB.net


thanks

Loading And Unloading Forms
VB6. When selecting from drop down menu options I display different forms by
using the Load (filename) and leave the form with Unload(Filename)



The Load event allows me to program the opening of a particular direct
access file and the Unload event lets me program the closing of the file.
Things are kept 'tidy' this way.



My problem is that I want to pass in a parameter when a particular form
loads. This will control which record is to be displayed. I want Pointer
to come in as a parameter.



Eg Seek #1, Pointer

Get #1, , MembRec



How do I do this?

Your help is appreciated



Geoff

Loading And Unloading Of Forms
How can unload and load the form faster?

cecile

The more u read, the more u do not know

Unloading And Loading Crappy Error :( Help!!!
Hello everyone,

I'm just having a crappy day today! Because this little error is really making me mad. Well i've been working on a MMORPG for awhile now and i'm programming the load screen where you log on it dosnt use DirectX but the rest of the program uses DirectX. I'm making for frmLogin do somthing like this...

Private Sub imgContinue_Click()
Load frmMain
If ConnErr = True Then
MsgBox "Error connecting to server, please check your connection or try afain in a few minutes.
ElseIf ConnErr = False Then
End If
End Sub

My frmMain Load routine goes through the basic check connection and if connected then start the main program and then it goes to full screen and you can play the game fine untill you escape and then when you escape it shows an error:

Runtime Error 364:

Object was Unloaded

Then it highlights Load frmMain in my imgContinue Sub Routine

I also have unloaded frmMain in other places of my program.

I have tried to reverse it and turn Form_Load in frmMain into a Public sub but then it ignores my Private Functions when I call it from my frmLogin.

Please help!! How can I load frmMain without this error and have all my Functions work correctly?

Long Loading And Unloading Delays
I've been working on a level editor in vb for a while now. Just recently it started taking a long time to load and unload.

I set a breakpoint at my first executable statement and it took 5 min to get to it. It also took 5 min to unload.

Is this normal? What are some causes of this and how can I fix them?

Loading/Unloading Controls At Run-time
I am using the following:

VB Code:
Public Sub CreatePictureBox()    ControlNumber        For m_intIndex = 1 To m_intContolNumber        With frmMain            Load .pb(m_intIndex)            Set .pb(m_intIndex).Container = .picWorkArea        End With                With frmMain.pb(m_intIndex)            .Visible = True            .Top = 50            .Left = 50            .Height = 500            .Width = 500            .Appearance = 0            .BorderStyle = 1        End With    Next m_intIndexEnd Sub

Let's say that I wanted to "delete" this control, that would then be unloading right? Therefore, because I "Loaded" the control from an existing one, does that mean I can "Unload" it too?

For example:
Load .pb(m_intIndex) 'loads the picturebox
Unload .pb(m_intIndex) 'delete/unload it?

Thanks in advance.

Loading / Unloading Forms Quickly
Hey, well I am currently making a game in which when the users player moves to a certain place on the form that form is made invisible, and the next form is shown, however there is always a small loading time ( around half a second ) although it doesnt sound like much it is annoying.

Is there anyway of making this quicker?

I tried preloading the forms first like this so i could just set the visibility to true but it still lagged


Code:
Load frm1
Load frm1

frm1.visible = false
frm2.visible = false

Slide The Form While Loading/unloading
Hi

I used to make a timer with about 15 intereval and write in it this code

sub load_form()
me.width=0
me.hight=0
end sub

sub .._timer1
me.hight=me.hight+100
me.wighth=me.width +100
if me.hight > 5000 then timer1.enabled=false
end sub

but it's performance slow on some old computers like pintium 233
So any other profissional way

Sorry for this bad code language bczz i don't have vb installed here on this com.

Loading And Unloading Forms (Resolved!)
I have an app that starts in Sub Main by checking to see if the app is already running, and if not, it loads the splash form

Code:
Private Sub Main()
If App.PrevInstance Then
End
Else
frmSplash.Show
End If
End Sub



the splash form will hide after 10 seconds or if the user clicks on it, and then Loads MainForm---


Code:
Private Sub Form_Load()

'do a bunch of waiting and stuff
Load Mainfrm
End Sub



and in the Load MainForm event I unload frmSplash

Code:


Private Sub Form_Load()
Unload frmSplash

'do a bunch more stuff

End Sub

my problem is that Sub Main never completes and when I unload frmSplash, I get an "Object was Unloaded error"
How do I get around this, OnError Resume Next??????

kevin

Copyright © 2005-08 www.BigResource.com, All rights reserved