VS 2008 - Creating Instances Of Controls On Form?

Sep 14, 2010

Is it possible to create instances of controls on a form ? Of course I mean visually , not just by code. After all, these languages define themselves as "Visual" so they should provide that possibility. It is important for the instances to be visible during design time because otherwise we could only guess where those controls might "land". Nevertheless , I have the feeling this is not possible in VB .NET but still I thought I should ask first ...

View 11 Replies


ADVERTISEMENT

Creating Multiple Instances Of A Form?

Aug 12, 2009

I have a form (form1) and I havea button on form1 (button1) that will start a second form (form2).How can I make it create multiple instances of form2 when button1 is clicked?i tried a process module that the studio comes as standard but it does not allow me to start multiple instances...how can i do this?

View 14 Replies

Creating Multiple Form Instances In A Subroutine?

Aug 23, 2010

I am trying to create a subroutine that creates multiple instances of a specific form.

Here is my code:Public Sub NewFormInstance(ByVal FormName As Form)

Dim FormInstance As New FormName
FormName.Show()
End Sub

View 3 Replies

VS 2008 Multithreading Or Creating Project Instances

Feb 15, 2011

I have been trying to create good multithreading programs and it is not working well considering the use of global variables, local variables etc and thread safe controls. I have not found a good way of doing it since it seemed to be not as efficient as just running it on a single thread.

The program accesses facebook and twitter api, parses etc. and I am wondering if I can just create new tasks and map the program project file and fire new instances of the project. Someone this using the taskfactory in 2010 but I thought this was just the same as the threadpool. on this: create windows services and set them to run on task scheduler??

View 2 Replies

Creating Form Controls At Runtime?

Jan 5, 2011

I want to create a Panel dynamically on the form when a button is clicked. Also labels with given TEXT are also to be created when create label button is clicked. then we should be able to print the form contents as it appears but without any buttons. We should be able to resize the panel to adjust the page size.

View 1 Replies

VS 2008 Close Multiple Instances Of Form?

Aug 30, 2011

I have 30 instances of the same form running. Video array with different video on each. Each form is named "oneForm". I'm looking for a way to close all forms with one click. I have found that I can hide the forms no problem like this.

for each killfrm as form in my.application.openforms
if killfrm.name = "oneForm" then
killfrm.hide()

[code].....

View 4 Replies

VS 2008 Opening Up New Form Instances With Different Datasets?

Mar 24, 2009

I�m fetching data from an access db, filtered by date and an ID. The data is then charted on a form (form1).

I want to be able to "duplicate" the form so that the data that is shown on form1 is shown on a different form. That forms data is not supposed to change when I change the data on the first form.

So far I�ve put som code in a contextmenustrip that opens another form1, but the chart is not showing on that form at all.

I'm thinking that I'm going about this the wrong way so I thought I'd ask you guys what you think I should do?

A little info: When Form1 opens up, it loops through selected dates in a listbox, querying each date. This takes a little time, so I decided to put the data in a dataset on form_load, and then do the drawing from the dataset on form_paint, thus not having to query the database each time the form needs repainting. why the second (or third, fourth etc) form1 doesn�t display the chart?

View 2 Replies

VS 2008 Resize Multiple Instances Of Same Form?

Jan 15, 2009

Within the subroutine, I am counting the number of open Forms and dividing the bounds of the screen by the number of open forms everytime a button is clicked.his gives me a way to Size each video box perfectly according to the number of forms open.This is where I have found a problem. The size of the new window only sizes the newly opened on and will not resize the ones that are already open. I will give an example of my subroutine.Note: Because of the nature of my program, I am not allowed to take any code out of the work zone and so I will be summarizing what I am doing rather than showing the actual code.

Private videoShow (byval videoName, byval videoIp)
dim videoForm as new form
videoForm.size = New Drawing.Size

[code]......

View 11 Replies

Creating Instances Of An Object?

Nov 21, 2006

I'm trying to create 3 instances of the the Workshop selector form for the 3 individuals that I have inthe listbox to appear when I first run the program.

View 4 Replies

VS 2008 Awckward Behavior From Multiple Form Instances Loaded Into A Dictionary?

Jul 27, 2009

Ok I have a project which has a MDI parent. Inside the parent I have multiple isntances of a form load(frmLine1t5). When my program loads it will load a different form(frmSelect) and if I manually load a different form(frmRetests) I can put frmSelect on top of frmRetests and bring one another to the front if it's clicked on(without using the bringtofront method)However as soon as I load a single instance of frmLine1t5 I immediately can no longer bring ANY form loaded into the MDI parent(before or after frmLine1t5 has loaded) to the front. I can only bring them to print IF I use .bringtofront method

View 1 Replies

Creating Instances Of Own Class At Runtime?

Sep 3, 2011

info on creating instances of my own class at runtime. Simple project for family recipes but would like the option to add new recipes with new instances of my own food Item class at runtime. Creating my own class,no problem. Storing the data in an XML file, OK on that as well. My issue is creating new instances of different food item class as I use this program over time

View 13 Replies

Creating Object Instances Globally?

Nov 19, 2009

this is probably something I should know, but I'm puzzled by this.I'm trying to create some objects and being able to access and modify these globally. I tried to create a Public Module and declare a few objects in this.I am able to access these from another sub, but I get an exception error when after building and runing the process and trying to modify these object. The same thing happens if I declare the object in the Public Class Form1. For example like this:

Public Class Form1
Public appWord = New Microsoft.Office.Interop.Word.Application
Public wordDoc as Microsoft.Office.Interop.Word.Document

[code]....

View 1 Replies

MEF Import Is Creating Two Instances Of Every Part

Nov 25, 2011

I am using MEF to compose a number of components at run time but when I use a metadata attribute it double the number of parts in the collection.

When checking the container.ComposeParts I can see that the dll containing the 11 implementation of IStages is loaded once and only the 11 part required appear but when it resolves the Private Property Stages As IEnumerable(Of Lazy(Of IStages, IStagesMetadata)) the number of instances is doubled to 22. Looping through the collections I can see that they are duplicated by the ID in the metadata.[code]...

View 1 Replies

VS 2008 : Programmatically Creating Controls?

Sep 24, 2009

I have a panel that is a set size and has its Autoscroll property set to True.I am parsing text files and then adding them to the panel. I'm extracting specific lines and then adding them to labels and text boxes that are in the panel.When my app runs, it can parse anywhere from 0-10 files at a time.If there are no files to parse, I don't want any controls in the panel. I'll be creating the controls based on how many text files I have. For each text file, I'll have 3 controls.

I'll count the text files before I parse them, and insert the controls into the panel.The problem is that I don't know how to place the controls based on the location of the panel/form. I know the panel will always have a permanent spot, but I won't know if the location parameters of the panel have changed because I won't know how many controls there will be before the app parses the files.

However, I will know the size of the controls that I'm inserting.So, with all of that, is there a way to insert the controls inside of the panel, and then based on that information, insert the others?

View 12 Replies

VS 2008 Creating Controls With Code?

May 15, 2011

The editor basically uses a bunch of labels and pictureboxes (for now) and then an image is created from the panel which contains all of the controls.It sounds quite confusing, but basically i'm trying to create something like visual studio itself, which will allow "controls" to be added onto a panel, and then everything can be exported as an image when the user chooses to.I've worked out all the code to move controls and exporting the image, just having trouble trying to work out how to add an event for newly created controls as you can only handle a control, and not a variable.

View 3 Replies

Creating Instances Of A Class That Has Several Readonly Properties?

May 24, 2011

What is an elegant way to create and initialise instances of a class that has several readonly properties? Passing all values in a constructor would not be very convenient.

The purpose is that instances are immutable after initialisation. However if the constructor is not used for initialising all the property values, then how can the readonly properties be changed from another class?

View 2 Replies

Creating New Instances Of Form1 With Variable Properties

May 13, 2009

I'm trying to elaberate on some basic examples of .Net programming in using VB. The basic example of creating a new instance of Form1 is:
Dim x as New Form1
x.Show
I've added some OptionButtons to set the StartPosition of the Next Instance of Form1 as well as some Labels that display the Top, Left, Width and Height properties when the new instance of Form1 is Shown.

This is the code I'm using.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As New Form1
If Me.RadioButton1.Checked = True Then
x.Top = 0
x.Left = 0
[Code] ......

View 1 Replies

VS 2010 - Creating Multiple Instances Of Subs

Jul 31, 2011

I'm creating a twitter account manager using the Twitter API. I have multiple accounts, over 10 of them. I want to automate all 10 of these accounts to do certain things, now the way I started to code the program was so that it would accommodate only one account, and all the codes worked perfectly and were managed by individual timers for individual processes that I wanted done. i could tweet between certain intervals, follow people who tweet certain things without me being on top of it.

Now the problem is that I've been trying to create new instances of subs that I've already created so that I dont have to create 10 new subs with the exact same procedures. I'm pretty sure it's impossible to create copies of subs dynamically or within a loop but it didn't stop me from trying. So question is how can I edit a program that was designed to accommodate and automate only one account, to potentially accommodate over a 100? I don't need codes or anything I need ideas so I can try them, but right now I'm completely blank.

View 2 Replies

VS 2008 Creating Dynamic SerialPort Controls

May 31, 2009

I need to create some serial port controlls manually. My program reads through a config file, and it if comes across an entry called COMPORT then I need to create a contol to talk to this port. The entries in the ini file might be

COMPORT=COM1
COMPORT=COM3
COMPORT=COM7

So here is my problem! I'd like to create the variable control name with part of the com port number, so I can always refer back to it.
EG.

Dim strVar as sring = "COM1"
Dim CName+strVar As New System.IO.Ports.SerialPort

View 1 Replies

Creating An Array Of Instances Where Instance Could Be Base Or Sub Class?

Oct 31, 2011

I have a class structure and am attempting to create an array of object instances from the class some instances are parents and some are children Code snippets,

Parent Class object
Option Strict On
Option Explicit On
Public Class cTransportItem

[code]....

View 1 Replies

VS 2008 Good Tutorial For Creating Custom Controls

Jul 6, 2009

Can anyone point me to a good tutorial for creating custom controls. I want something that is actually understandable.I have gone through a few but nothing really any good at this point. I want to create my own contol that uses its own look and not just modifying a windows control.

View 2 Replies

VS 2008 Dynamically Creating And Adding Dropdown Controls To DevExpress XtraGrid?

May 6, 2011

I am dynamically creating and adding dropdown controls to DevExpress XtraGrid.That works fine and I can add a dropdown control to any column I wish.My main problem is that I need to have the first element in the dropdown control displayed. But after I dynamically add 3 dropdown controls to the grid, only the last one has the element displayed. The previous two do not.Although, I add the elements

this is what the code looks like:

vb.net
Dim column as DevExpress.XtraGrid.RepositoryItem.GridLookupEdit
For i as Integer = 0 to dsSometing.Tables(0).Rows.Count - 1
column = New DevExpress.XtraGrid.RepositoryItem.GridLookUp

[code]....

The code will go tru and add lets say 3 dropdown controls, set their .DataSource to datasets I need, but it will only show .NullText of the last added control.

View 1 Replies

Create Different Instances Of A Form?

May 1, 2011

The below Code is written inside the Timer Tick event. It works fine as long as the Time and Date are not same. When the Time and Date are same it only displays 1 message. How can I show multiple message for the same date and Time ? I think this can be done If I create different instances for a form. But I don't know how many same time and Date will be there in the database. So I can't do that.

Dim frm As New frmMessage
Dim nowDate As String = String.Format("{0:M/d/yyyy}", DateTime.Now)
Dim nowTime As String = String.Format("{0:h:mm tt}", DateTime.Now)

[Code]....

View 1 Replies

Handling Instances Of A Form?

Aug 5, 2010

(simplified) I have a button in form1 that creates an instance of a form2, fills some data unique to that instance, and shows it. This data should be unique. Any attempt to create an identical form2 should fail, and instead bring to front the matching form 2, but if the form 2 is filled with different data (representing a different person) than it should be created.

View 3 Replies

How To Create New Instances Of Form

Jun 14, 2010

I am using the following code to create new instances of a form
Dim nfMainForm as New frmMainForm
nfMainForm .Show()
And when I open multiple instances of the form then I need to reference controls on specific instanced of the Form then I dont know how. i.e. I need something like
nfMainForm(0).lblFullName.Text

View 10 Replies

Multiple Instances Of A Form?

Sep 13, 2010

If I create a console application for example with a class named "Person" I can create an object variable with a ceratin name only once. For example:

Module
Module1
Sub

[Code]....

View 1 Replies

Multiple Instances Of The Same Form?

Mar 3, 2010

I have two forms in my application. Form 1 is a listview that is populated with unique Customer IDs. When the user double click the listview on the particular Customer ID then it loads Form2. Form2 has many listviews within it such as a listview for the Customer telephone, another listview for their addresses etc and all the data presented in Form2 listviews are based on the Customer ID that the user clicked in Form1.

So here is my question...I want the user to be able to open Form2 with that particular details of the customer but also to go back to Form1 and double click another Customer ID and opens Form2 again (such as replicating Form2) with the other Customer details.So the moral of the story is i want the user to be able to have many instances of Form2 open each time they wish to view a different Customer ID without having to close Form2 down every time.

View 3 Replies

VS 2008 - How To Put Controls On Top In Form

Dec 20, 2010

I have a form with MenuStrip, ToolStrip & StatusStrip. Placed a panel with a 5000 x 7000px image and scroll bars are on form and scroll the image fine. Problem is that all controls appear to have changed size to size of image and also scroll with it horizontally. When scrolling vertically, the image covers up the menu and tool strips. How I can keep the controls on top so they don't attach to the image in the panel?

View 2 Replies

VS 2008 Of Form With Many Controls?

Oct 8, 2010

I have Winforms application that holds dozens of controls.Now I'm planning another functionality where I have to move some of the controls and put others instead of them.I have to let the users to choose during runtime whether they prefer ver A or Ver B (means the other controls).

I have doubts what's the best practice to replace the controls.Should I hide the controls and replace them by others in runtime? (then the form may look messy during design time)Should I place them in a panel/group box and then replace the panels? (could be problem since I have some controls that should be displayed on both situations)

View 1 Replies

Count The Instances Of The Form.show()?

Jun 21, 2010

I have so many form to manage. I want to count the instances of a particular form. For example, if I show my form1 two times then there must be a counter for my form1 and if I also shown my form2 another counter for form2.I want to do this to minimize the instances of forms to be shown so that my resources will not burden to much.I want my code to be generic so that I can easily call it for my other forms.

View 11 Replies







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