VS 02/03 Single Form Instantiation

Dec 9, 2009

I just like to know if how can i do single form instantiation upon loading my Form..upon loading my MainForm it automatically detect if that MainForm is still exist..ive try putting my code in the contructor of my MainForm..i check through the process in the task manager if that MainForm is still exist..but i think this is not the good idea bcoz..the MainForm takes several seconds to appear..and i think this is bcoz i loop through the process.

View 1 Replies


ADVERTISEMENT

Using A Single Picture Box To Display A Single Picture Form A Bank Of Pictures?

Mar 22, 2011

I have a few problems i need to solve. Firstly, I am looking for a piece of code i can use to display a picture from a bank of pictures. It will work on the basis of generating a random number and loading a picture that corresponds to that number.

i.e. Dim RandNumber As Integer
Dim RandClass As New Random
RandNumber = RandClass.next(1, 10)
If RandNumber = 1 Then
Picturebox1.image = picture1

[Code]...

Secondly, can I then use subsequent picture boxes to display pictures from the same bank of images, without displaying the same image? Finally, I then need to be able to click the picture or a button beneath the picture to select it as an answer to a question and then the whole process starts again.

View 1 Replies

Class Instantiation - Getting Too Many Arguments?

Oct 24, 2011

I have a class:
Form
Public Class Form1
Dim teamlist(2) As team
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
teamlist(0) = New team(1, "one", "First")
[Code] .....
Error I'm getting is too many arguments.

View 3 Replies

Instantiation Of An Object Containing Two Other Objects

Jan 20, 2010

I am having some real issues with this one. I have a class which contains two other objects...but I cannot seem to instantiate those sub objects. Here is the code for my class:

Option Explicit On
Public Class Boot
'A collection of Heads and Shells

[Code]....

Notice the count for my two objects, Ohead, and oShell, is zero. Im not sure why this doesnt instantiate properly, as I believe is what is going on.

View 2 Replies

NHibernate HQL Dynamic Instantiation?

Jun 27, 2012

I can't find what's going on with the following nHibernate HQL.

here's my VB.Net code:
Return _Session.GetNamedQuery("PersonAnthroSummary").SetInt32(0, 2).UniqueResult()
My Named Query:

[code].....

View 2 Replies

Implement Variable Class Instantiation?

Nov 22, 2011

I have several similar classes but only want to instantiate one of these classes dependant on a selection from my main form.

View 4 Replies

Insert Values Into Dictionary On Instantiation?

Nov 3, 2009

I can insert values into a VB.NET Dictionary when I create it? I can, but don't want to, do dict.Add(int, "string") for each item.

Basically, I want to do "How to insert values into C# Dictionary on instantiation?" with VB.NET.

var dictionary = new Dictionary<int, string>
{
{0, "string"},
{1, "string2"},
{2, "string3"}
};

View 3 Replies

Instantiation - Equivalent Of A Nameless Variable In C#?

Mar 31, 2011

In C#, you can do this:

new MyClass().MyMethod();

The method is executed and the reference is (typically) discarded since no reference to the object is kept.Is this possible with VB.NET (.NET v4)?

Edit: I suppose this is a better example:

new Thread((x) => doSomething()).Start();

View 4 Replies

Pass A Type To A Constructor For Instantiation?

Mar 7, 2011

What I want to do is pass a Type to another object's constructor, where the other object creates a new instance of Type. I can create a constructor with a parameter declared as System.Type without problem, but when I try to instantiate it tells me there is no such type.

Public Sub New(targettype As System.Type)
Dim Test As System.Windows.Forms.Form = New targettype
End Sub

View 3 Replies

Private Variable Instantiation: When Defined Or Within Constructor?

Jun 24, 2010

I don't know if this has been asked before, but we're having a discussion about it today at my job. Should private variables (that are shared/static) be instantiated when they are dimensioned/defined, or is it a better practice to do this inside of a constructor?

Public Class IpCam
Private Const HOST As String = "http://test.com/url/example"
Private Shared _Example As New OurClass(HOST)which one to use?

[code].....

View 4 Replies

Publishing Single Form Form A Group Of Forms?

May 28, 2009

In my ASP.NET(2.0),VB.NET Project,around Around 150 people are using this site inside the companyFrom these 40 Forms ,Can I to publish one Form (Visitor.aspx) to another site

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

How To Unload A Single Form

Jun 29, 2009

Me.Close()
MDI.Show()
Me.dispose()
MDI.Show()

i am using this code but in both condition whole wpplication gets closed i just want to dispose that single form what to do?

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

Forms :: Many Pages In Single Form?

Mar 1, 2010

i wants to load many pages in same form which each of the pages contains different messages.example....if i press more in the page no1(form 1) it should load the page no2 at the same form(form 1)...

View 1 Replies

Get A Single Form That Is Held In A Dictionary?

Jul 6, 2009

I can't seem to get a single form that is held in a dictionary(of integer, <Form>) to create instances passed 229 times.

For instance i can only open 229 instances of the same form. I open and close the form. So technically i open 229 forms and close 228. Any forms opened afterwards give a win32 exception. I clear the the dictionary key upon form close.

I have changed the dictionary declaration to (of long) but get the same issue.

View 23 Replies

Make An Single Instance Form?

Aug 4, 2010

I have a mdicontainer form that summons forms. My problem is when the a user clicks again the menu for that form, it also make another instance of it.

What I did is declare a public class with a public variable on it ex: Boolean isFormOneOpen = false. Then every time formOne opens, it checks first the global variable I declared a while ago if it's false, if it is, instantiate an object of a formOne and then show it. Otherwise, do nothing. Very static, imagine if I have many forms, I have to declare a variable for each form to check if it's already open. Maybe a method that accepts a Form? Or any more clever way to do this.

View 2 Replies

MDI Single Form Or Multiple Forms

Mar 7, 2010

I've written an application with about 30 forms and am almost ready to publish, my biggest concern though is that i'm not sure if its a normal thing to do having all these forms and hiding, disposing and showing forms throughout the use of the application.I've toyed with the idea of converting to a MDI Child / Parent interface as well as having one form with lots of subcontainers that are hidden and then hiding / showing them as the navigational buttons are shown.Ive worked on this application for about 8 months now, but would be happy to rewrite the interface and appearance of it if i know that it is not generally an acceptable practice having forms flashing open and closed while navigating through the application.

View 3 Replies

Single Form With Multiple Instances

Aug 12, 2010

I have a form which displays temperature and humidity data for a device in the field. I have multiple devices. Rather than creating a separate form for each device, obviously it is much better to have a single form that I instantiate, pass data to, and display. The devices are listed in a treeview, and when the user double-clicks the node, I create an instance of the form, pass the device's data to the instance of the form, and display the form. All of this works perfectly. However, I have a challenge: If the form for a particular device is already open, I don't want another one opened when the user double-clicks the node.

However, whenever I place logic in the program to check for the existence of the form and only allow another instance to be created if one doesn't already exist, it prevents me from creating a form instance for any other device that I may wish to view, simultaneously. So, I have a dilemma -- allow the user to display the data for multiple devices, including allowing multiple forms to be open for a single device, OR only allowing one device to be displayed at any given time.

View 2 Replies

Create A Child Window In Single Form?

Jun 18, 2009

i am doing windows application in vb.net , i want to know how to create a child window in single form.

View 3 Replies

Multiple Instances Of A Single Control On A Form

Apr 6, 2012

I've got two sets of lists with nearly 800 items that I need in 32 different drop down comboboxes (before you ask, that is required and it can't be simplified). Understandably, populating each of them slows down the creation of the form. This happens to be a child form that these drop downs are on and there could be more than one child form displayed. I've assembled the lists in List(Of String) objects and set each of the datasources of the comboboxes appropriately, but it still takes several seconds for them to populate and display for the first time. This is also problematic if the datasource gets updated (items removed, added, renamed) because I have to wipe out all the items and create the list again in all active instances.

[Code]...

View 3 Replies

Single Command Shell (cmd.exe) In Interactive Form?

Jun 17, 2011

I would like to have the single command shell, aka cmd, in my app within a form in an interactive way.

View 6 Replies

Access Single Bytes That Form A Double Variable?

Sep 20, 2009

How can I get access in a fast way to the single bytes that form a double variable?

In pseudo-code I want to do something like this:

Dim myDouble as Double
Dim myArray(7) as Byte
myArray = myDouble

'continue doing things with the single bytes

The code is meant for use in a I/O-handler. The double-variables have to be sent / received via TCP. For this purpose they shall be put into / assembled from I/O-buffers.

View 2 Replies

Extractinga Single Charcater Form A String/text?

Oct 22, 2009

dim rownum as interger i need to extract "6" from the string

listviewitem {6} into the variable rownum

View 4 Replies

Password Protect A Single Form In A Winforms Application?

Nov 21, 2011

I've a winforms application that is using SQLite database. There is no encryption on the database (data has to be shared with other user). It is a stand alone application with a stand alone local database.

The difficulty I'm encountering is when people go to bring all the data together.The databases are attached, data imported, but records are differentiated by a database GUID.At any rate I am desiring to have a database selection screen that is protected by a password to prevent users mistakenly switching databases (and some level of protection against malicious use).

Thinking it's probably not a particularly good idea to store the password in an unecrypted database.Security is not a large issue as this is only distributed to users that need the software.

What would be the best method to have the user type a password when they attempt to access the database selection screen? ShowDialog? Pop open a new child form with a password TextBox, then on validation (via button?) close the password form and open the protected form?I see a fair bit about protecting a whole application, but not so much about a specific form.

View 1 Replies

Set Some Form Controls (textbox) To Values From A Single ADO.NET DataRow?

Sep 9, 2010

I'd like to see how others might handle this scenario and perhaps provide some comments on this particular solution for handling null values. I have run into a situation where my application requires data from an ancillary source that cannot be altered/changed, which of course means dealing with poor database architecture and implementation! In this case, my app is running into errors when attempting to set some form controls (textbox) to values from a single ADO.NET DataRow. Perhaps I should be handling this when attempting to set the controls? Not sure, but here is the current way this is done:

View 7 Replies

Single Form With DataGridView Showing Values From Oracle DB

Feb 2, 2010

I have a single form with a datagridview on it showing values from an oracle database. I am trying to set up a way of detecting if the row/column I click on is empty or not, just as a little exercise. I have so far got this:

Private Sub DataGridView1_CellClick(ByVal sender As Object, _
ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) _
Handles DataGridView1.CellClick
Dim c, r As Integer
c = e.ColumnIndex
r = e.RowIndex
[Code] .....

The message going into lbl2 shows the co-ordinate values of any box I click in but as you can see with the IF statement below I am trying to see if the system can detect whenever I click in a value that is empty (null or ''). When I run my form and populate the list with a column of names I can click in 0, 0 cell and I get a message saying the 'Box is not empty' as above.

But when I click in any of the next boxes e.g. (1,0) (2,0) etc I get this:
'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index'

Pointing to this line of
If Not DataGridView1.Item(r, c).Value Is Nothing Then
Not sure what this means at all. I am under the impression that my piece of code is gathering the value of the item depending on the co-ordinate values. so why should this fail? What index/collection is VB talking about?

View 8 Replies

[2008] Updating Multiple Tables From Single Form?

Jan 28, 2009

After making the changes or adding a record I use invoke childmethod from my toolbar to call these subs. The first table updates and adds, but the second does not. I have set all of my textboxes databindings and double checked them. I get no error, but it does not update the second table. What am I doing wrong?

Public Sub AddRecord()
'Clear out the input data fields on a new Add.
ClearInputFields()

[code].....

View 2 Replies

Is Running Multiple Threads Faster Then A Single Thread On A Single Core Cpu

Dec 23, 2009

Say I have a code with 3 methods that do some pretty intensive work. Would executing these methods on 3 seperate threads be faster then executing them one after the other on a single core cpu? And what if it's a dual core or HT?

View 8 Replies







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