Checking The Visibility Of A New Form Instance?

Jul 18, 2012

I am using VB.Net 2003 (version 1.1) and I am attempting to open some forms with:

Dim myform As New FormX
If myform.Visible = False Then
myform.Show
End If

Problem is, no matter what, a New instance of the form opens. How do I check if an instance of myform is already open?

View 5 Replies


ADVERTISEMENT

Create An Instance Of A Text Box And Given The Name Of Another, Change The Visibility?

Aug 7, 2009

I have a hash table which contains the names of all my textboxes in my program. Then I have a function which takes in a string name of the text box and searches a the list of keys for the name. Once this name is found I would like to use the instance of the text box to be assigned the name of my target and change the visibility. Whereas if it isn't found I would like to ensure that the visibility is set to false with this instance of the textbox.

Private Sub HideBoxes(ByVal strName As String)
Dim thisTEXT As TextBox
For Each objKey In Hash.Keys
If objKey.ToString = strName Then

[code]....

View 2 Replies

Creating Single Instance Form In MDI Application - Check Whether Form's Instance Created Or Not?

Feb 8, 2012

creating single instance form in MDI Application. How to check whether form's instance created or not?

View 6 Replies

Disable/Change Visibility Of Large Number Of Text Boxes Quickly And Efficiently On Form

Aug 6, 2009

I have a form which contains a large number of textboxes covering numerous panels/tab controls and I would like to have the user only have one text box visible at a given time and when the user clicks on the screen to another label with a corresponding text box I would like that to appear and the other currently open to disappear. Currently I have the following loop that goes through and changes the visibility of the appropriate controls unless it is the name of the control I am looking for:

'This is used to iterate through all the controls in the form and ensure the visibility of all other controls
' than the active control is set to false.

[Code].....

View 8 Replies

Asp.net - Checking For A Session Variable... Returns (Object Reference Not Set To An Instance Of An Object)

Jan 12, 2011

In the Session_Start of the Global.asax i have

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Session("login") = False

[code]....

Why i am getting error the error Object reference not set to an instance of an object. at line

If Current.Session("login") Is Nothing Then

while checking for the login state as follows?

If GetLogin = False Then
'Do something
End if

I mean i have already created the instance on the Session_Start... Haven't i?

View 1 Replies

Single Instance Application Is Checking For A Totally Different Application Being Run?

Aug 26, 2009

I'm writing vb.net code with MS Visual Studio 2005.When running my application I get "foo.exe is already running on this machine".(Even though I'm running faa.exe instead

View 14 Replies

Create New Instance Of A Form That Does Not Close Then The Parent Form Closes?

Oct 28, 2009

I have been making a webbrowser for a while now, everything works well, except i am unable to make the 'open in a new window' button work right. So far i have managed to get a new instance of my form to open with the right url, but i am unable to keep that new form open when the orginal parent form closes.

Code:

Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
e.Cancel = True
Dim Href As String

[code]....

View 2 Replies

.net - Finding Out Which Instance Of A Form Initiated Another Form Or Module

Oct 5, 2010

I'm trying to figure out the best way to reference a control on a form from within a module. Unfortunately the form is just an instance, so it's not as easy as calling form.control...

Dim ChildForm As New frmSearch
' Make it a child of this MDI form before showing it. '
ChildForm.MdiParent = Me
ChildForm.Show()

That form has an option for printing, which calls another form where certain options are chosen. The print form in turn calls a function in a module, which tries to reference back to the origional form.

childform as new frmSearch -> frmPrintForm -> sub okToPrint (in module Print)
okToPrint tries to reference a listview on frmSearch, but can't find it.
For Each itmX In frmSearch.lstResults.Items

So the solutions I can think of off the top of my head are:

1. Somehow divine which form is the caller of frmPrintForm

2. Pass ChildForm to the frmPrintForm as a variable to be passed on to module Print..

3. Use frmSearch directly instead of using an instance of it.

Number 1 would be my preference, as I don't want to have to pass forms around like that.

View 4 Replies

Checking Data For Login Form With Sql Database

Jun 4, 2011

I sware I am loosing the will to live, I have tried to accomplish this by my-self for about 2 weeks now and I am still at square one.

I am writing an application for booking conference rooms and I need a login form.

I have created my database called Users in sql and inserted 2 default login accounts, admin and default.

I dont know how to compare the data in my database to the data typed into the username and password text boxes on the login form.

see what I have so far

Imports System.Data.SqlClient
Public Class LoginForm1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code]....

I know that I have to create a click event handler for the login button and put my code in there to compare the data

View 14 Replies

Decrypting And Checking RegistryKey Value On Form Startup

Aug 16, 2011

I have encrypted a user inputted value and successfully stored it in the Windows Registry. Now I am having problems Decrypting that RegistryKey when my Form starts up and making sure it is the same key that was originally stored. My decrypting code has been working but if I go inside the Registry and add an extra character on to that keys value, my program is still running.. It is not supposed to run if that RegistryKey is not the one that was originally user inputted..[code]And I also have tried A LOT of other examples, but I am not going too post them all. So is there anyway I can check if a RegistryKey exists and Decrypt it to make sure that it has not been changed on my programs startup?

View 9 Replies

VS 2005 - Boolean Checking - Better Performance By Checking For A True Value

Aug 4, 2010

Is there any better performance by checking for a true value like this:

[CODE]..............

Than like this:

[CODE]..............

View 5 Replies

Check If .show() Has Been Called Rather Than Checking If The Form Is Visible?

Apr 22, 2012

I call .show() and .hide() on a form and then I want to determine the current state. I've been checking .visible to determine if the form is visible, but I've stumbled uppon a problem. My form is being rendered inside a SplitContainer which I collapse each time I hide the form. So, by logic once I hide the form with .hide() it is no longer visible, and since I have collapsed it's container, even if I call .show() it would still NOT be visible couse it's container is closed.

So, how can I simply check if .show() has been called rather than checking if the form is visible.

The final goal is to show() / hide() the form along with collapsing / un-collapsing the container.

P.S.: I know I could simply check the container and show the form accordingly, but my form also supports detaching from the container, so that wont work for me.

View 1 Replies

Forms :: Best Approach To Checking Conditions Before Loading A Form

Feb 2, 2011

I have a form which asks for a username and password to connect to a MySQL database. Before I load the login form I would like to place a check to see if the connection information is stored in the My.Settings.<connection string..I am using Sub New() in the Form.Designer to do this by placing the following [code]The connection form does show but when i close the form there is a blank form that shows up.

View 3 Replies

Login Form - Checking Entered Username And Password

Jun 9, 2011

I had created login form in vb.net. There are two fields username & password. I want to check username & password enter in the login form, from the first.mdf (database file). If it is correct then message is displayed. I had written code for this but I got error in the code.

The code of login form is below:
Imports System.Data.SqlClient
Imports System.Data.SqlClient.SqlConnection
Imports System.Data.SqlClient.SqlCommand
Public Class Login
Inherits System.Windows.Forms.Form
[Code] .....

View 1 Replies

Programmatically Checking/Unchecking A Checkbox In Windows Form

Jan 10, 2012

I have two checkboxes in a windows form, one is called New Assumption the second is called Edit Assumption. What I want to do is that if either of these checkboxes are checked then the other should be unchecked.

I have tried using the CheckedChanges event, CheckStateChanged event and Click Event for each of these checkboxes and these events dont seem to be activated anytime I click the checkboxes.

What event and code should I use to uncheck and check checkboxes programatically based on which checkbox a user clicks on?

View 2 Replies

MakeTextbox Visibility?

Jan 30, 2012

i am trying to do an assignment and trying to figure out the best way to implement it. My problem is i am telling sub-procedures to make this textbox visible and not visible depending on the selected change index. Is there anything wrong? In the form the visble property is set to false, but shouldnt it become visible when the index is changed?

'Developer- John Nelson
'Date- Janurary 30th, 2012
'Application Name- Calculate Your Commute

[code].....

View 8 Replies

Closing MDI Child Form By Checking Any Process/Operation Is Running?

Jan 4, 2012

I'm developing Applications in VB.NET 2008.

I have MDI Parent Form and i'm going load all form as MDI child. Here i'm going to give option to "Close All" toolstripbutton in top of MDI Parent to close All mdi child forms.

Now i would like to check that On click of Close All Toolstripbutton , i have to close all mdi child form but except those form is on process, example, I have opened/Loaded 5 MDI child forms within MDI Parent Form.

Child forms are ( just for example ) ,

1. Customer details Form

2. Item Details Form

3. Import Orders Form

4. Stock Details Form

5. Production Entry Form

Here 3.Import Orders form is importing from Excel with 5000 records and 4. Stock details form exporting to excel.

So now if i click "Close All" button then i have close only Idle form i.e 1,2 and 5 but i should not close 3 and 4 since its on some process.

So Is there any .NET option to check that form in process/idle or do I have to check manually by having any Flags ?

View 1 Replies

Call Form In One Instance Only?

Jun 21, 2010

I have so many form in different module in one solution. I already instantiate a new Form as a global variables in my parent form. Then, call the code

frm.show()

in my button1 event

View 6 Replies

Call New Form Instance?

Sep 2, 2009

I have program requirement, I need to call an existing form to an MDI form by using a new form button and when I click it of course it will show my existing form, but I want is to create a new instance of the existing form, which make the the other forms different from one another inheriting the controls of the form I called. What I mean is I can create many child forms inheriting the controls of the existing form I called.

Dim newform as new System.windows.form
'this the function will call when on click the new form
Public Function newform()

[Code].....

View 4 Replies

Creating New Form Instance?

Jul 7, 2011

I have a form with a button. I want the button to show a new instance of the same form but I don't know what to do. I'm working in vb.net 2010

View 3 Replies

Default Instance Of Form In .Net But Not In C#?

Jan 15, 2011

there is The (Name) property, which represents the name of the Form class.This property is used within the namespace to uniquely identify the class that the Form is an instance of and, in the case of Visual Basic, is used to access the default instance of the form.

Now where this Default Instance come from, why can't C# have a equivalent method to this.Also for example to show a form in C# we do something like this:

//Only method
Form1 frm = new Form1();
frm.Show();

But in VB.Net we have both ways to do it:

//'First common method (used slash because editor wouldn't format it properly)
Form1.Show();
//'Second method
Dim frm as New Form1();
frm.Show();

1) My question comes from this first method. What is this Form1, is it an instance of Form1 or the Form1 class itself. Now as i mentioned above the Form name is the Default instance in VB.Net. But we also know that Form1 is a class defined in Designer so how can the names be same for both the Instance and class name. If Form1 is Class then there is no (StaticShared) method named Show().So where does this method come from.

2) What difference they have in the generated IL

3) And finally why C# can't have an equivalent of this.

View 2 Replies

Have Single Instance Of Form?

Mar 15, 2007

I have windows application and a form. If I open a form named "DetailForm" from main form named "Main1" by clicking the button, it should open only once. The problem I am having is, it is opening many instance of the form every time you click the button.

View 8 Replies

Have Single Instance Of The Form?

Jan 19, 2011

I then have an iteration (For Each loop) which lists all of the OUs on our site (set by the filter property). The issue here is within my treeview it lists everything without mimicing the AD structure we have.When searching on this it seems i have to change the search path to be one below the current OU and add it to my child node. I believe the search path is held in my RootDSE??, but when i look for the distinguishedName and try to pass that in i receive an

View 1 Replies

Name Of Startup Form Instance?

Aug 2, 2010

this might be a really dumb question, but if someone could enlighten me I'm writing a Winforms application in VS2008 vb.net.The application starts with a main form. I've got a status bar at the bottom of the main form, indicating the application status. I've got a 'SetAppStatus' method on the Main form.

I'm writing a class that needs to update this status. So in the class I'm Importing the Main Form. But I don't know how to call this SetAppStatus method because I don't know what the instance of the main form is called Plus am I doing this the right way? I'm still grappling a bit with how .NET all fits together and it can get a bit baffling :)

View 10 Replies

Open Only One Instance Of An MDI Form

Apr 26, 2004

I am using the following code to open an MDI form from a parent form...

[Code]...

View 4 Replies

Reference A Particular Instance Of The Form?

Apr 1, 2012

I am currently trying to reference a new form that has been created, but I am unsure how I reference a particular instance of the form.

The form that has been created can have up to 4 different instances. Each one is created from the menu. The code that is executed is identical, with a parameter passed 1,2,3,or 4 The form is created with

Dim newScreenDisplay As New ScreenDisplay

and has all the usual text boxes and buttons etc. on it.The display is then kept up to date by refreshing it from variables. This task is performed by a background thread.What I can't work out is how to reference the specific instance of the form that I created as they all have the same name (newScreenDisplay).

View 1 Replies

Reference An Instance Of A Form?

Apr 26, 2010

I'm showing a form like this[code]...

Then I am trying to update a progressbar on that form from a public sub in a module, but I don't know how to reference it. I can't use "Me" because I'm not doing the updating in the forms code

View 4 Replies

Second Instance Of A Form Displaying

Nov 10, 2009

I've been working on a project now for some time and as a result, when I have something new to try out, I do a little "proof of concept" project and then port it over to my real project (mainly to make it easier to follow when trying to work out new issues).Up to now, I've been relatively successful at it.But here's what I'm running into with this particular project.First, a little background.When the operator enters data into certain input fields (textboxes), either a listview or a datagridview appears displaying multiple columns of information.Once the line is selected with the proper info (equip. id or type of job or whatever), that info gets displayed in the textbox.The problem occurs when display is clipped by the window size.Let's assume for simplicity sake that I can't enlarge the display window.

So I rethought that and decided to create another form that has no borders and the only item displayed is a bound dgv.So I created a proof of concept project that consisted of two forms: form 1 that contains a text box and form 2 that contains a dgv control.when run, form 1 is displayed.When I type a character in the textbox, it calls form 2 and searches the dgv for the first char I entered.Since form 2 is the current form, as I enter additional chars, I build the string, search and if the chars are valid input chars, echo them to the textbox.Once the data line on the gridview is found, the tab key is used to do the select, close form2 (the dgv) and populate the textbox of form 1.This all worked.That is until I tried to port it over into my real project.This is where I'm obviously missing some key aspect of VB.Net and how all the forms and threads and handles work.To get right to the issue and skip alot of what happens in my real project, I was able to duplicate the problem by just creating one more form in my proof of concept project that just has a button on it.That button when pressed, brings up form 1.When I start to type in the textbox, after I enter the first character, form 2 displays, which is as expected. But when I enter the second search character, a second instance of form 2 opens and it searchs for the second character I typed.If I enter another character, it gets added to the second char and located in the dgv of the second instance of form2.When I press the tab key, textbox of form 1 does not get updated but the second form2 does close.The first form2 remains.

View 7 Replies

Test For Instance Of A Form?

Aug 30, 2011

I have a form (frmResults) that contains a button (btnConsole) which when clicked it tests if the class level variable (cv_frmConsole) is Nothing.If so, it opens a new instance of a form (frmResultsConsole).When the user closes frmResultsConsole,then clicks btnConsole my code throws an exception, because the code below "Else" is run.I want to properly test if an instance of frmResultsConsole already exists.If so, show the form even if the user minimized it or it's hidden.If not, open a new instance.

Public Class frmResults

Private cv_frmConsole As frmResultsConsole = Nothing

Public Sub New[code].....

View 5 Replies

VS 2008 New Form Instance?

Jul 15, 2009

I have a form template on my IDE, I want to open a new instance of it depending on what button is clicked, how can I do this?

View 18 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved