VS 2008 Setting Form Instance To Nothing?

Jun 25, 2009

in Old vb/VBA, I am accustomed to doing THIS when I instance a form object (as in "pop-up"):

Private WithEvents SomePopUpForm As Form_PopUpForm
Private Sub cmdEdit_Click()
Set SomePopUpForm = New Form_SomePopUpForm
SomePopUpFOrm.Visible = True
End Sub

[Code]...

View 5 Replies


ADVERTISEMENT

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

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

Setting The DataContext On An Entity Instance After It's Retrieved?

Apr 14, 2011

I'm trying to find a way to have the DataContext available from within Entities.

I want to do something like this:

partial public class MyEntity
public DataContext as MyDataContext
private sub OnLoaded()

[Code]....

View 2 Replies

VS 2008 MDI Multiple Instance Of Same Form?

Mar 24, 2010

I am in the process of trying to build an app that will permit multiple instances of the same form be added to an mdiparent as seperate mdichildren. The reason for this is that the child's data is based on a sql table's row information. Thus child one shows requested data from row 1, child two shows requested data from row 3 etc.

I have this setup so that each child is its own seperate tab in a tabcontrol. My problem is that after the second instance of the child is created the form in the first tab is disappearing after the line:

child.midparent = me

I don't understand what is causing this.

Dim child As Form = Support
Dim tab1 As New TabPage
child.MdiParent = Me

[Code].....

View 3 Replies

2008 Debugging - Form That Creates An Instance Of A New Class

Dec 8, 2009

I have a form that creates an instance of a New Class. The code is simple so there is no issues with the programming.

I can step through the code on the Main Form without issues. Stepping Into moves from 1 line to the next.

I can't seem to debug the code within the class though. I set breakpoints but "stepping into" doesn't work. The code gets executed, but it doesn't step through each instruction.

I've tried changing many of the options within Tools > Debug with no luck.

I've tried deleting files from bindebug and obdebug.

Not being able to debug my programs.

View 6 Replies

VS 2008 Check If Form Is Loaded Before Starting Another Instance

May 19, 2009

I have a Parent form that loads a child form and I only want to allow one instance of the child form. I have this on the button to open the form. Stepping through the code with the debugger it "appears" to work OK when the form is open (I say appears because nothing changes) but when the form is closed it doesn't open as I would expect. What am I missing?

[Code]....

View 6 Replies

VS 2008 - Setting Database Path From Form?

May 18, 2009

I have an application that's going to be portable so it's likely the path of the database itself (access mdb file) will change so hard wiring the path in the app.config isn't practical. I would like to create a 'Settings' form for the user to enter the path (browse for would be ideal but I can figure that out later) of the database file and save it for future use with the same app. I've found a few things out there talking about creating a new app.config file alongside the original with a 'key' defined but I'm not sure how that relates to the original app.config and how it would call the new variable to make the connection.

View 3 Replies

VS 2008 - Setting Mdi Form's Opacity Within Parent

Feb 26, 2011

I can't find a way to change the opacity of a mdi form within it's parent. I can change the parent form's opacity under properties, but can't change the embedded mdi form's opacity under it's properties. Opacity = 0.5 doesn't change the opacity of the mdi... works fine for the parent form. I was hoping that the embedded mdi forms functions would still be independent of the parent in order for me to change it's opacity.

View 2 Replies

VS 2008 Setting Form Size To Anything Smaller Than 132 X 38

Jun 6, 2012

How do we set a form size smaller than 132 x 38 pixels? I would prefer any native vb.net way (if possible) over use of any windows API.

View 10 Replies

[2008] Setting Picturebox Location On Form?

Feb 14, 2009

i need a picturebox to, when an event has happened to either revert back to its original place.or set a location for it to go after the event has taken place.ive tried lots of different code but its not working?

View 3 Replies

VS 2008 - Setting Location And Making Form Unmovable

Oct 28, 2011

How would I make my form unmovable so you cannot drag it to move it? I also need to know how to make it always start in the same exact spot. I don't know why but it changes spots even thought the location is set: 0,0

View 3 Replies

VS 2008 - Setting Form Sizes According To User Screen Resolution

Mar 17, 2011

I'm setting form sizes according to user screen resolution and I think I need design no smaller than 1024 x 768 these days. Using the following code I set my first form and use Anchor settings to resize and maintain controls. Does resize affect StartupPosition in other forms and what do you think is the best StartupPosition to Show the next (smaller) forms? I have a feeling I should have created child forms but simply added forms to the project as I needed them. For example, the first code example does not take account of the WIN7 Task Bar.

HTML
Dim x As Integer = My.Computer.Screen.Bounds.Width, y = My.Computer.Screen.Bounds.Height
Me.Size = New Size(x, y)

A smaller form loads with the same code slightly varied, but the reduction is not taking account of the screen resolution. Is there a way of reducing by percentage?

HTML
Dim x As Integer = My.Computer.Screen.Bounds.Width, y = My.Computer.Screen.Bounds.Height
X = X -100
y = y - 100
Me.Size = New Size(x, y)

View 12 Replies

VS 2008 Setting A Delay - Allow Another Form To Load After My Program Display's

Feb 28, 2010

I need a way to allow another form to load after my program display's an introduction cut-scene without loading the form in the middle of the cut-scene. Sort of like a delay.

View 2 Replies

VS 2008 : Setting The Form Opacity Programatically In The MouseEnter And MouseLeave Events?

Feb 14, 2010

setting the form opacity programatically in the MouseEnter and MouseLeave events.The problem isn't with the actual events, the problem is that the events occur in places where I don't want it to happen.So in my project, I have a form with 3 user controls in it. The user controls are docked in the form so no actual space from the form is available to the user.

I have the methods:

Form1_MouseEnter(~) Handles Form1.MouseEnter, UserControl1.MouseEnter, UserControl2.MouseEnter, UserControl3.MouseEnter
Form1_MouseLeave(~) Handles Form1.MouseLeave, UserControl1.MouseLeave, UserControl2.MouseLeave, UserControl3.MouseLeave

when you enter the form, the form opacity is set to 1. And when left, the form opacity is set to 0.7 .However, what happens right now is obviously that when the user changes the mouse position from one user control to another, the form opacity flickers (turns to 0.7 and back to 1 really fast).

View 15 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

Passing Setting Value Back To Form That Had Called The Form?

Feb 1, 2010

This is what I have..Dim frmSettings As New frmOptionsfrmSettings.ShowDialog(Me)frmSettings is a settings form that you can choose the color for background of form1(Me)

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







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