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




Chosing Which Form Shows First...


how do i choose which form is shown first?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Showing Form From Array Of Form Shows 2 Forms?
Everytime this if statement runs it displays 2 Forms. One which is empty, no caption and no text and the other with a caption and text. any ideas why?


Code:
'if theres a empty loaded im box
If frmIMs(i).Caption = "" Then

'set new form
Set frmIMs(i) = New frmInstantMessage

'set imers username
IMer(i) = UserName

'load new form
Load frmIMs(i)

'show new im form
frmIMs(i).Show

'set new form's caption
frmIMs(i).Caption = UserName

'update chatlog text

frmIMs(i).richChatLog.TextRTF = frmIMs(i).richChatLog.Text & UserName & ":" & UserMsg & vbNewLine

'scroll to bottom of chatlog text
frmIMs(i).richChatLog.SelStart = Len(frmIMs(i).richChatLog.Text)

'set last message received on panel
frmIMs(i).StatusBar.SimpleText = "Last message received on " & Date & " at " & Time

'flash window
Call FlashWindow(frmIMs(i).hwnd, 1)

'if away message set
If AwayMessage <> "" Then
ProcessAwayMessage (UserName)
End If

Exit Sub
End If

Unwanted Form Shows
I started programming with a normal form as the startupform. I have several forms now and replaced the initial startupform with an MDI as the startup object (and made all my other forms 'CHILD')...


Unfortunately when I run the program some of my forms are loaded when I'm not wanting them to. I had to add some useless 'Unload frmxx' code to my project to prevent this...
Before, when I didn't have an MDI, it never happened.

I'm almost sure I'm not loading these forms in my code...

How comes they appear anyway

tia

Form Shows Up Late
I'm making a Form that shows a file copying progress. The copy procedure starts on FormLoad. What I'd like to do is to show the whole form and the label.captions... before it starts copying. 'Cause now it just copies the files and shows the form after that.

Form That Shows Loading Bar
how would i go about making a preload form that displays a loading bar and then loads the main mdi form after its finished...? here is an example

Frame Shows Form
How can I make a frame(the one vb6 provides) show a form?

I tried this but it didn't work:

Private Sub Frame1_Load()
Frame1 = Form.show
End Sub

Anyone knows how?

A Quickie: Which Example Shows Better Form?
I have a quiz program that runs quizzes built off simple text file scripts.

One of the functions in the quiz editor is to jump the cursor to the first question. To do this I split the lines of the text box into an array called LineStr(). I start from the top and skip the optional file info tags, answer pools, and first chapter mark.

Tell me which way of tackling this a seasoned VB programmer would approve of more:


Code:
x = 0
Do
Temp = Left$(UCase(LineStr(x)), 5)
Select Case Temp
Case "TITL:", "AUTH:", "COMP:", "MODI:", "MVER:", "NOTE:", "TIME:"
x = x + 1
End Select
Loop Until Temp <> "TITL:" And Temp <> "AUTH:" And Temp <> "COMP:" And Temp <> "MODI:" _
And Temp <> "MVER:" And Temp <> "NOTE:" And Temp <> "TIME:"


or


Code:
x = 0
Do
Temp = Left$(UCase(LineStr(x)), 5)
Select Case Temp
Case "TITL:", "AUTH:", "COMP:", "MODI:", "MVER:", "NOTE:", "TIME:"
x = x + 1
Case Else
Exit Do
End Select
Loop




I know it seems totally trivial, but I just want to write code that won't have my fellow programmers scratching their heads or rolling their eyes.

Chosing Colour
I want to let the user chose colours for a control - what's the component I need to get to get them to chose from a slection?

Chosing From Available Modems? HOW?
Hi guys,

Part of functionality of my program is dialing
a user specified number.

Question: how do i display all the modems that a user
has on their system (in a combo box) together
with the COMM PORT and most importantly assign the numeric
value of a that comm port to variable in that programm.

Eventually it has to have a similar functionality as
if you pressed Ctrl+Shift+D in Outlook, then chose
"Dialing Options..." - Connect Using line frame contains
combo box I am looking to implement.


Thank you and Kind Regards

P.S. If you have a slightest idea please share, 'cause there
is absolutely no info on this topic anyware.

Excel Opens, Form Shows
hi everyone!
i was wondering if you know some trick so as to make Excel show a form every time it's opened, no matter the file the user wants.
(so i guess "workbook_open" doesn't deserve to be considered)
suggestions?
thanks! >>> damkauf

Displaying A Form So It Shows On The Taskbar
I have an ActiveX DLL which contains a particular data entry form. When the DLL is called by an appropriate EXE, and this form is displayed, it does not appear on the taskbar despite having the 'ShownInTaskBar' property set to true.

The form itself is set to 'Fixed single', it has a control box, minbutton and maxbutton ... but with any combination of these I still cannot get the form to appear on the taskbar.

Any ideas and help greatly appreciated....

A Label Which Shows The Errors From A Form !
Hello there,

I have two userforms.

1 Userform with two textboxes and a commandbutton, these textboxes must be entered.
After clicking on a commandbutton "next" the second Userform appears.

If the two textboxes are empty, i want to show a little report of what whent wrong!

Can i do this with a label? I have no idea how to do this!

Janroen,

DIM An Object Dynamically Chosing 1 Of 2 Dll's?
I have two seperate dll's (I'll call them test_1.dll and test_2.dll) that write to different devices. The methods, properties, and events for the two dll's are the same, but the code behind them are different. What I would like to is to be able to use one subroutine to write to either device, but I seem to be having trouble doing so. Here's the basics of what I'm doing with the code at the moment.


VB Code:
Private sub DevWrite()    dim TestDev as test_1   set testdev as new test_1 '<--- Create an instance of the device object    testdev.open              '<--- Try to access the device   if testdev.err = 1 then   '<--- Device not present      testdev.close      set testdev = nothing      dim OmniDev as test_2  '<--- Use the second device insted      set OmniDev as new test_2   else                      '<--- Device present, so let us use it      testdev.close      set testdev = nothing      dim OmniDev as test_1      set OmniDev as new test_1   end if    OmniDev.open   '*** Rest of sub goes here   OmniDev.close   set OmniDev = nothing end sub


The problem is that when the subroutine is called, I get an error stating the OmniDev is defined twice. Is there a way to dynamically dim OmniDev as either test_1 or test_2 based on whether or not the first device is present?

Thanks.

P.S. Yes, there is much more to the code including error handling in case niether device is present, I just need to know how or even if I can dynamicaly set OmniDev as one object or another.

Form Shows When User Opens Msword
"form shows when user opens msword"
how can i do that? huh?
thanks again! >>> damkauf
p.d: when will be the day when i don't consider myself a begginer?

Press A Button And A Form Frame Shows Up
Hey guys I have a form with tabs on it. Is it possible that when I press a button on another form it shows the form with the tabs, but automatically goes so a certain tab on top?

Thanks!

Avoid Do While From Stopping When Modal Form Shows
I have a Do While routine (including DoEvents) on a module that applies certain something to an always visible form, but whenever I show another form as vbModal, the Do While is paused. However process from timers keep running... is the only solution for this to use a timer, or can I modify the Do While to keep runing during modal forms display somehow?

Form Shows Up Behind Current Form?
I am doing a frm2.show from the Form_Load event of frm1 if a certain situation exists. However, frm2 always shows up behind frm1. I tried to mess with ZOrder...with no luck. Any ideas? Thanks in advance!!

Hiding OLE Container's Object Menu That Shows Up On Form
I have an OLE Container object containing an Excel worksheet. When the worksheet is activated (double-clicked) in order to enter data, an abbreviated Excel menu displays on the form where a form's menu would normally be. When another control on the form is activated, because the OLE container loses focus, the menu disappears as well.

My form has no menu, so when the Excel menu displays all the controls move down and they shift up again when the menu disappears.

I've recorded an Excel macro that hides the menu bar and it comes out as:

Code:
Application.CommandBars("Worksheet Menu Bar").Visible = False
I've tried each of these statements within my VB project and although none of them give me an error none of them work either. (xlBook is defined as an Excel Workbook)

Code:
xlBook.CommandBars("Worksheet Menu Bar").").[b]Visible[/b] = False
xlBook.Application.CommandBars("Worksheet Menu Bar").[b]Visible[/b] = False
xlBook.CommandBars("Worksheet Menu Bar").[b]Enabled[/b] = False
xlBook.Application.CommandBars("Worksheet Menu Bar").[b]Enabled[/b] = False
Anyone have any ideas? Thanks in advance.
Nate

Hiding OLE Container's Object Menu That Shows Up On Form
I have an OLE Container object containing an Excel worksheet. When the worksheet is activated (double-clicked) in order to enter data, an abbreviated Excel menu displays on the form where a form's menu would normally be. When another control on the form is activated, because the OLE container loses focus, the menu disappears as well.

My form has no menu, so when the Excel menu displays all the controls move down and they shift up again when the menu disappears.

I've recorded an Excel macro that hides the menu bar and it comes out as:

VB Code:
Application.CommandBars("Worksheet Menu Bar").Visible = False

I've tried each of these statements within my VB project and although none of them give me an error none of them work either. (xlBook is defined as an Excel Workbook)


VB Code:
xlBook.CommandBars("Worksheet Menu Bar").").Visible = FalsexlBook.Application.CommandBars("Worksheet Menu Bar").Visible = FalsexlBook.CommandBars("Worksheet Menu Bar").Enabled = FalsexlBook.Application.CommandBars("Worksheet Menu Bar").Enabled = False

Anyone have any ideas? Thanks in advance.
Nate

Form Shows On Taskbar But Not Visible. Works On My Machine, Not Others
Ok then...i developed the app on one computer, but when I ran it on another machine the forms would not show up on the screen. They were on the taskbar but you could not see the forms themselves. The question is what could cause this. I tried making them always on top and everything.

Due to the positioning in my code, the form was placed off the screen since the new machine was at a lower resolution than the development OS. So when it donned on me I knew it was just a stupid question..but maybe itll help someone...



Edited by - jfisher446 on 9/6/2006 8:01:23 AM

Display A FORM Before Setup Shows Completion Msgbox
i created an application in VB 6.0 and MS_ACCESS, then i make a package using Package and Deloyment Wizard,
OK
Now Can i show my FORM before setup shows message box that "SETUP WAS SUCCESFULL"? if yes then how, can i get a code for that?

Dynamic Installed Textbox Shows Up Underneath Other Controls On Form
the
form1.controls.add("vb:textbox",etc)

installs the textbox on the form, but under the other controls.
How do you get it to lay on top of the other controls on the form?

thanks

Which "Load" Event Shows The Form?
I was curious which load event actually shows the form and which don't. Is it showen before/after "Load", before/after "Activate or what?

I need to know what event I should hide my loading screen on.

Also, when my form appears it kinda lags for a second while all the controls load up (but the window is already showing). Is there a way to know when all the controls are loaded so I can keep the form invisible until then?

Grid Shows B-A Instead Of A-B
Hi, All!

My grid is showing the last item in the array first instead of the first item. Tried looking for a Sort property for the grid (MSHFlexGrid), but there isn't one. Don't know where else to look.

Below is the code.

Any help would be appreciated!

Thanks in advance,

vbprogwb (Bob)

'ReDimming the array
'As names and etc., are added to the Little Black Book

ReDim BlackBook_RecArray(totalRecs)
RecCount = totalRecs

Grid1.Col = 1
Grid1.Row = 1

'This fills up the array with Type - udtItemRec/itemStruc

For X = 1 To RecCount
Get #1, X, udtItemRec
BlackBook_RecArray(I) = udtItemRec.strLName & Chr(9) & udtItemRec.strFName & Chr(9) & udtItemRec.strPhone & Chr(9) & udtItemRec.strEmail
I = I + 1
Debug.Print BlackBook_RecArray(I) 'x = x + 1
Next X


I = 0

For I = 0 To RecCount - 1

If I <> RecCount Then
Debug.Print BlackBook_RecArray(I)

Grid1.AddItem (BlackBook_RecArray(I)), 1
End If

Next I

BitBlt (nothing Shows Up)
Hi, I want my pic1 picturebox to show up somewhere on top of the screen (which displays over EVERYTHING). My project file is attached. I have been trying to figure this one out for some time now.

Thanks in advance.

Vb Shows 2 Forms Instead One
i made something like de MDI sample from the VB help.when i reference the first element of the array(an array of forms),Vb loads 2 forms.And the UBound() of the array shows that is only one element in the array.
That'is when i reference array(0),Vb shows 2 forms and UBound(array)=0.any idea?
thanks

Err.Number Shows 0
I have the following code that, on an error, writes to a DB.
The problem is, when I get the first error in the select case,
run-time error 76 - Path not found
my error reporting doesn't show Err.Number as 76 but 0
Also Err.Description is empty as well.

Am I missing something obvious here?

vb Code:
Private Sub mnuHelpBackup_Click()On Error GoTo ErrTrap Dim BackupDestination As String 'get backup destination from registry (Options form)BackupDestination = GetRegistryStr(hkeyCurrent_User, strSubKey, "BackUpPath") 'copyfile actual fileFileCopy App.Path & "CLDB.mdb", BackupDestination & "CLDB.mdb" Exit Sub ErrTrap: Select Case Err.Number    Case Is = 76        'path not found - possible folder deleted or moved        MsgBox "The selected path does not exist. It may have been " & vbCrLf & _                "moved or deleted. Please select a new path.", vbOKOnly + vbInformation, _                "Path does not exist"                    Case Is = 4004        'Backup failed        MsgBox Err.Description & vbCrLf & "Error number " & Err.Number, _                    vbOKOnly + vbInformation, "Backup Error"    Case Else        MsgBox "Database cannot be copied." & vbCrLf & "Error Number = " & Err.Number & vbCrLf & _                "Error Description = " & Err.Description, vbOKOnly + vbInformation, "Backup Error"End Select     ProcedureName = "frmCodeLib mnuHelpBackup"Call ErrorControl(strUser, Err.Number, Err.Description, ProcedureName, _                    Format(Now, "dd/mm/yyyy"), Format(Now, "hh:mm:ss"))


EDIT
When run in the VB IDE this works, but when I compile the program, I get the problem explained above.

Listbox Shows Twice The Same Value
Hi, I was just wondering how do you do this:?

Add something to the listbox but if the value I added is already in there, then it does not come up again. For example, If I add the Name "George" to the listbox and try to add it again, the name "George" should not come up again since its already in there.

How can I do this with the IF....THEN statement?

Thank You,
EnYcE

Color Cursor Shows Up B/w
I loaded various color cursors into form/picture box properties but they only show up black on white. Any ideas why?

You Slove One Problem And The Next Shows Up
ok i need to clear the form so that the bullets wont make a line but by clearing the form the "plane" blinks and it is very annoying. make it stop blinking or tell me how. sry if the dl doesnt work right this is my first time using it

PPT: Access Custom Shows
I've been looking for help with this for days and I'm just stuck. I want to select powerpoint slides defined in a custom show and copy them to a new presentation. The only thing google turned up was a 3rd party extension...and that won't work. Frustrating.

ActivePresentation.SlideShowSettings _
.NamedSlideShows("Quick Show").Delete

You'd think, I just change "delete" to "copy"...but no...that doesn't work either.


I got this far, but it shows the slide IDs in a message box; I need them to add themselves to a range Array and I can't figure out how to get them there instead of in a mesage box:

idArray = ActivePresentation.SlideShowSettings _
.NamedSlideShows("show a").SlideIDs
For I = 1 To UBound(idArray)
MsgBox idArray(I)
Next
ActivePresentation.Slides.Range(Array(I)).Copy
Presentations.Add WithWindow:=msoTrue
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutTitle).SlideIndex
ActiveWindow.View.Paste




I'm lost. Any help greatly appreciated.

Flexgrid Shows No Rows
I've been away from VB stuff for a number of months.
Today I opened up my projects and none of the mshflexgrids shows any rows.
I've got them bound to ado controls. I've tried doing an adoctrl.recordset.recordcount to make sure that there should be rows to show, and I get the correct amount of rows, but the rows never show in flexgrid.
The same is true with all the flexgrids in all my projects.

Control That Shows Webcam
Where can I get a control that shows me my webcam's picture, and let me capture it and stuff? I'm sure that there's already one on my computer, but maybe not.

Thx!

Flexgrid Shows Only One Line
I have a problem where a flexgrid will only display one line of data on one machine in the network - it works perfectly on the other machines in the network.
The data is being loaded from a text array.
Thanks for any hints on what may be causing this strange behaviour.

Nothing Shows After Maximizing The Window
Hi:

I’m relatively new to vb. I’m using vb 6 and am having problems with a window not showing correctly. The application uploads a file via ftp to a server. If the window is minimized while the file is being uploaded and then is maximized again, nothing shows in the window until the file is through uploading. I’m not quite sure where to start to correct this. Any help would be appreciated.

Thanks in advance for the help.

Chris

Which Type Shows Decimal.
Hi, im doing a sub routine that calculates a number that is shown as a currency in an excel sheet.

When i had the variables set to Long's it was fine but seemed to round to the nearest number. I tried variant and that worked but then an adding formula i had wouldnt work because it took the values as strings. So im stuck kinda. Either i find a type that works or find out how to switch the variant into a long in the subroutine. Thanks.

Date Shows Up As Time
When updating a record in my table with a new date, the date shows up as a time when I query the record. Looking at the field inside the actual database it looks like there's a date with the year 1895 (not sure how that got there) and a time. Here's my code:

dteDate = Date
strSQL = "UPDATE Topics SET DocumentName = """ & strFileName & """, ChapterTitle = """ & strChapterTitle & """, TopicTitle = """ & strTopicText & """, Notes = """ & strNotes & """, DateModified = " & dteDate & ", IsAddenda = " & blnIsAddenda & ", ProjectName = """ & strProjectName & """ WHERE ID=" & intRecordID & ""
myDB.Execute (strSQL)

The column in my Access database if set to the ShortDate format. Any ideas? Thanks.

If Nothing Shows Up Have A Listbox Say Sometihng?
Hey guys i have a listbox called list11, and it has the results of a scan from a button. IS there a code to get it that if nothing shows up in the list11 listbox, that an item would show up saying "Nothing found"

??
thank you.

When I Run My Program The Code Shows?
When i press play, the code shows up instead of the form..any ideas?

yt

Text Box Shows Number
hope you understand this i need some coding.......

If i type a number from 0-82 in text1 i want text2 to show the number 1
if i type a number between 83-174 i want text2 to show the number 2
if i type a number between 175-276 i want text2 to show number 3

this seems like really simple coding but i am a noob to vb i am just messing with it thats how i learn

VbTab In String Shows A Bar??
I have a string as follows

str = "ABC" & vbTab & "DEF"

when I put str into a flexgrid cell the tab converts into a thick vertical bar.

What do I need to do for it to actually put in a tab?

Thanks as always!

Steve

ps. I am still bang my head against the wall regarding how to define a Band in an Hierarchal Flex Grid (so I can make different columns different background colors)

Textbox That ONLY Shows Numbers ??
How do i make a textbox that you ONLY can write numbers in ?
I thought of something like this:

VB Code:
If  txtNumbers.Text = "a" or "A" ThentxtNumbers.Text = ""End If


It works fine, but it will just be a hell of a lot of work !
And i'm... pretty lazy
Regards

Shows Up In Task Manager.
I'm writing a program in WindowsXP that I don't want to clutter up the users taskmanager window under Applications when its running. Now at first I figured I would have to register it as a service in the API but I found out that you can no longer do that in XP.

I was wondering if anyone else knew how to remove it from the Applications menu, and only make it show up if the click on the Processes menu next too it which shows all exes running.

Thanks for any help which you can render.

Which Control Shows The Desktop
Does anyone know which control, or how to manipulate the DriveList Control, to show the Folders, My Documents, My Computer, and Desktop, As they are shown in the SaveAs Dialog in most of the Office Products?
Thanks In Advance

My Installed .exe Shows A Message
Hey, friends, look what is happening to me:

After finished, I made a distribution package of my VB 6.0 program (.cab, setup.exe, and so on)

I tried to install it in several pc's, all of them with at least win95.
In some of them, when attemping to install, a message appear telling me something is needed about windows installation and the system must be restarted. When this, I did it.

In those cases, after restart the computer, I have to run setup.exe again, and the program is installed succesfully. (it seems to).

But when I try to execute the program at start-programs menu, a new message box appears telling me something like:

"You don't have the right license to use this functionality"

What's happening?

I do not understand why, cause it does not ocurrs in every computer, some of them work perfectly.

Somebody knows why?

Heyner.

Textbox Shows A Date
i am adding a summary to my application ..
how can a text box shows the last modified record date ( the date for the last record entered to the Database ????)

What API Shows A PictureBox In Greyscale?
Hello,

I'm developing an Activex control and need to do a PictureBox show a picture in
greyscale.
Is there a Windows API to do that?

Thanks for any help

michel_junior@hotmail.com

Data Shows On My Computer But Not On Others.
Hello all,

I've been working on a project that displays data from a Data Environment object which connects to a few different Access databases. Everything works fine on my computer, but when I try it out on another computer, none of the data loads for one (and only one) of the forms. Does anybody know any possible reason for this to happen?

The only difference between the data on this form and the others is that I was using data shaping, but I re-configured things to avoid data shaping and the problem is still there.

Kael

Grd Shows More Data Than It Should. URGENT
I have a datagrid connected to a table in an MS Access 2002 database by ADODC. This table contains a list of items.
When I run the program, the grid shows the complete list of items but at the end  there are some of these items re-listed again (like ghosts of previous rows). These additional rows do not exist in the underlying database table when I open it alone with Microsoft Access.
I tried to delete the ADODC control and put a new one. I also tried to remove the grd and put a new one. No use.

If I simply delete these rows, then I check the database table, the original rows that are not repeated are missing.

What's going on?

Eman_2005
Technical Communicator
www.smartistek.com

Minimize To Systray Still Shows Title Bar
I followed the tutorial on min to systray and this now works fine. However, i have set showintaskbar to false and when i min to systray it still appears as a moveable title bar on my desktop (sorry i dont know what the correct title for this thing is - basically the head of my form). Any ideas how to remove this so when i min to systray i'm left with no trace of the program until I double click (on systray icon) to return it?

Thanks

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