VS 2010 Accessing Same Form But For Different Actions?

Jun 12, 2012

I have a datagridview on a form and this shows up my list of suppliers. I have a textbox which when i click shows up the supplier list and from there when i double click on a row, the supplier's name is shown in the textbox. The thing is i have to do same on the same page for search purposes which got its own textbox. But the cell double-click event already contains code that will display it in some other textbox like i mentioned previously. What i thought is to make another form with a datagridview. So this datagridview will be used to display the supplier's name in search textbox. But what if i have to access this form several times. Do i have to create several forms everytime?

View 7 Replies


ADVERTISEMENT

VS 2010 Accessing Unloaded Form

Jan 18, 2011

Im quite new to VB.Net so, this is what i have. A simple "console" form. Its just a form with a ListBox in it. To add stuff to the ListBox, i have to open the console, to let other forms know what the ListBox there is.

[Code]...

View 7 Replies

VS 2010 Difficulty Accessing 'disposed' Form?

Jan 18, 2012

I'm having a strange difficulty. Here is the order of events:User presses button on form1 New Form object is created for from 2 New form object '.show' command is fired Form 2 opens correctly In the Load Event of Form 2, the form attempts to do various things in a try, catch, finally clause On catch, I close form2 down '.close' as it cannot be used as something has gone wrong with the execution However, my problem is this. It is acceptable for things to go wrong on the from 2 load event which is why I have implemented the try - catch functionality. However, when I close the form2 down as a result of the problem, a real error ocurrs 'Cannot access a disposed object' and the VB IDE refers me to Form1's '.show' event for Form2.

It is almost as if the form hasn't fully 'shown' before I am closing it down. Does anyone have any idea what the problem is here? Do I need to close down Form2 ourside of it's Load event handler so that Form1 thinks it has loaded correctly?

View 3 Replies

VS 2010 : Multithreading And Accessing Other Routines/form Properties?

Mar 1, 2011

I'm writing a really simple file updater which downloads files off from a website and saves them. The download routine is working well, except that it freezes the project while attempting to connect to the host. Easily solved with threading except now when I try to access other form items such as text boxes, labels, form caption, it says I am not doing it in a safe manner and prompts an interrupt in debug. I did some reading on it and I'm still not sure what to do, I'm very new to vbnet and it is still a little confusing to me.

Error: Cross-thread operation not valid: Control 'Form1' accessed from a thread other than the thread it was created on.
Imports System.Threading
Imports System.Net
Imports System.IO

[code]....

View 8 Replies

VS 2010 Applying Actions To Multiple Controls

Oct 8, 2011

I'm very new to VB and am struggling with a problem! I have a form with mutiple (100) textboxes and buttons. I have set the properties of some of the buttons so that the text is draggable, but I want to be able to drag it to every textbox. I have posted a snippet of code below that allows me to drag ot to box 1 and 2, but is there any way that I can set it to drag to all boxes without having to individually specifying them? The same goes for dragging text between boxes...i'm sure there must be some way of specifying multiple drag and drop locations without the laborious task of specifying each as an individual sub? Code below

[Code]...

View 5 Replies

Key Press Actions - Arrow Keys Control A Little Square In The Form

Jun 12, 2011

so I've begun developing another little rpg like game w/ visual studio 2010. I'm trying to have the arrow keys control a little square in the form but I've searched all over the internet and haven't found too much useful info. So first thing's first, how can i make a key perform an action, and then, if you know how, what code do i use to make it move the square on the form.

View 3 Replies

Accessing Datasets Loaded In Main Form From A Child Form?

Aug 11, 2009

I have a program I've been working on for some time now and I'd like to try to streamline it somewhat. I have a main menu form that has a split panel, in the left panel is a treeview that displays forms you can open and when one is selected, it opens in a child window in the right panel. Each time I open form I called DWNForm, it does a series of dataset loads which are the populating items for a series of listviews.

What I would like to do is have these datasets load once during the mainMenu load and then have the DWNForm be able to access the datasets once it is called from the treeview selection.

View 8 Replies

Accessing Variables On A Parent Form From A Child Form

Aug 13, 2011

I have an array of variables called VolumeArray(12) which is declared as publlic shared in the main form1.I have a second form2 which allows the user to input various values. When this form2 is closed, I need the data the user has entered to update the values for VolumeArray(12) within Form1.

View 3 Replies

Accessing A Form In A Different Project?

Nov 30, 2011

how to access a form in a different project but within the same solution? Say I click a button on one form to display another form which is a part of the same solution but resides in a different project.

View 11 Replies

Accessing A Threaded Form?

Apr 11, 2011

i created a threaded form class that i call when i know an update is going to take a while....it is a simple form with a label and an animated marquee progress control. the code is listed at the bottom....whenever i try to set the message, it says i cant do it with error "{System.InvalidOperationException: Cross-thread operation not valid: Control 'MessageLabel' accessed from a thread other than the thread it was created on." from my form (in my SAVE function, i put the following line:[code]....

View 6 Replies

Accessing Controls From Another Form?

Jan 19, 2011

how can i access the controls that i made from another form? i'm also going to also use function (on the same form as the controls) that access that controls?

View 3 Replies

Accessing Database From Another Form?

May 17, 2012

i started using VB 2008 recently (with perl background, its a big leap) and having a problem with database.i am trying to access a database that is attached to a different form. i managed to get my code to work if i was writing on the same form.example of code that will work just fine Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

[Code]...

View 2 Replies

Accessing Dataview In New Form?

Jul 31, 2009

I have a form where I open an Access database with 3 tables. I have defined datasets and dataviews for these three tables in the main form. I want to open a new form and access and update the tables using the dataviews I've already defined. When I try to access a record from the dataview using the new form, it's not defined. Can I pass the data between forms or do I need to redefine it in the new form? This is the first time I've tried to use multiple forms.

View 6 Replies

Accessing Tabs Within A Form

Apr 5, 2010

I have two tabs on a form, and I would like to know how can I display the second one when a button is clicked? The name of my tab control is tabSurvey.

View 5 Replies

Accessing Second Form Listbox From First Form

Mar 1, 2010

how can i getting data from listbox in second form named listform while i am at first form..i have search it a lot on google but not find any usefull ans...

View 1 Replies

Accessing Data From Access To Form?

Jan 22, 2009

Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
'If inc <> -1 Then

[Code]......

i got an error at the time of execution .

View 1 Replies

Accessing Logic Value On Parent Form?

May 12, 2010

I have a button on my form that loads a dialog. I have a logic on here that I want to test, what ever method I try I alway's get 'Object reference not set to an instance of an object'dialog1.vb:

Code:Public mainform As SettingsMainForm If mainform.LogicCheck.Checked Then textbox1.text = true End if

View 2 Replies

Accessing MDI Parent From Child Form?

Jan 31, 2011

I am trying to access a control (statusbar panel) on my MDI parent form from a child form.

Here's my
(located in child form)
Dim frmParent As frmMain
frmParent = DirectCast(Me.MdiParent, frmMain)

[Code]....

Object reference not set to an instance of an object.

View 4 Replies

Accessing Properties Of Form Classes?

Feb 4, 2010

Accessing Properties Of Form Classes

View 1 Replies

Accessing Value In Textbox From The Different Form In Vb2008

Sep 29, 2011

I'm using visual basic 2008. I am done coding the CRUD... but i want it to have confirmation first. Then, i tried using panel, it works. but, my interface looks not organize. Is it possible to access the values in the text boxes from the other form?

For example: the client's information text box are on the form1 and once add button is click, the confirmation box will pop out. and the pop out box is in the form2. Is it possible to access the form1 text boxes from the form2?

View 9 Replies

Forms - Accessing Declared Form From Another

Jul 18, 2009

Basically what I need to do is change a textbox on Form1 (AKA mainwin) from Form2 (AKA loginwin) using data that is inputted into Form2. I've done this before with applications by declaring Form1 in Form2, but this time I just get a NullReferenceException error. Here's the code I'm currently using for Form2. Maybe someone here can tell me why it's not working. [Code] I can't figure out why it's not working. I've used this same method before and it always worked.

View 1 Replies

VS 2010 Accessing Controls Using Strings?

Dec 19, 2011

I want to be able to use a loop and reference controls using a string. The following code works for textboxes.

dim myControl as Control
dim ControlName as string
dim LoopCount as Integer
For LoopCount = 1 to 3

[code].....

View 5 Replies

VS 2010 Accessing Saved Records?

Feb 17, 2011

I am using VS 2010 and Access 2010 and in a table I have a Primary Key called Counter which is an Autonumber.When I save a record I need to be able to access the value of the counter field for the new record. When I try and access the field I get a value of zero.I can see the value in Access but I cannot set it in Vb.Net. I have set the fields and then

[Code]...

View 6 Replies

VS 2010 Accessing To Added TextBoxes

Feb 28, 2012

I've a problem with accessing to values of added TextBoxes. I'm adding TextBoxes in my application using NumericUpDown control (event of NumericUpDown1_ValueChanged). It' s value is 1 to 10 and by each step it adds 2 new TextBoxes (named TBC11i and TBC12i, i=1-10). I've created a second event (ButtonClick) where I want to use their values in a For Loop named like this:

[Code]...

View 5 Replies

VS 2010 Dynamically Accessing Variables?

Feb 26, 2011

I have a script where I make separate routines with identical code

Example:
sub AddToA {
ATotal += 1
}
sub AddToB {
BTotal += 1

[Code]...

View 10 Replies

VS 2010 Express Accessing Files?

Jun 1, 2011

My problem is that I have a program which needs to access images for multiple choice questions, hundreds of them. Now when I publish the program it is not taking the images with it. I have read some information by 'kleinma' regarding publishing and he says to right click on the Bin and click include in project, but when I do this there is no command in the menu for this.

I have included all of my image files in the Bin and have also added them using the resource editor, but to no avail As I have indicated it is the Express edition, could this make a difference

View 5 Replies

Accessing Class Obect From Another Form Within A Project?

Jul 22, 2009

I have created a project, and with form3, created a class for datagridview called MyDtGrd.nd when I created a form4 I used that same MyDtGrd. When I used before to publish the program no problem.But after publishing When I tried to make changes, giving error like"The variable MyDtGrd is either undeclared or was never assigned"Is there any technique to access the same class oject to use in other forms?

View 1 Replies

Accessing Multiple Form Controls Using A Variable For The Name?

May 23, 2012

I'm trying to iterate through a group of ComboBoxes and set a property using a concatenated string & variable to represent the name of the control. However, I can't get the instance of the form to recognize the (String & Integer_Variable) as one of its controls -- and so it doesn't recognize any of the appropriate properties or subroutines as members of the System.Windows.Forms.Control.Is there a cleaner way to do this?

For myTempCount = 1 To 6
If tempValue < Me.("ComboBox" & myTempCount).Items.Count Then
ComboBox.SelectedIndex = tempValue 'appears to work -- how?[code].....

This code was originally VBA / VB6, which I put through ArtinSoft's Visual Basic Upgrade Companion (VBUC). FWIW, I'm using Microsoft Visual Basic 2010 Express.

View 3 Replies

Accessing Public Shared Function From Another Form

Mar 1, 2011

[Code]...

i have a function that i have in my data access class now i want to access it then declare and assign parameters and then insert data into database.

View 4 Replies

User Control Accessing A Form Within The Project?

May 1, 2010

I have a "windows form" user control--that is, not on a web page etc. This user control has a form within the user control project. However, code from within the user control can't 'see' the form even though it is a public class---I don't understand why this is the case.

So how can I access the controls (a couple of radio buttons) on the form from code within the user control? I tried creating public properties on the form to return the state of the radiobuttons, but this still doesn't work. I get a "Reference to a non-shared member requires an object reference." error

Should I not be able to see the form since it is a public class?

View 2 Replies







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