Forms :: Retrieve Values From Objects Between Forms?

Feb 9, 2009

In VB.net how do you retrieve an value from a object in a different form.
eg:

' on frmMain

MsgBox ("Say ""Hello World"" Mr. " & frmOther.txtName.text)

View 7 Replies


ADVERTISEMENT

Forms :: How To Retrieve Values From The Database

Jun 7, 2012

i am new to vb.net and dont have any idea about using datareader.i am right now doing a project on vb.net and am facing an issue.i have a form, where in i have to select the matching records from the database and show it in various textfields. as far as the query execution is concerned, i have successfully completed it, but i am facing an issue now. Suppose, i have an Id of a student, and he has registered for 3 courses, when i give the query something like select students.studentid,courseid,midtermmarks,finalterm marks from marks,students where students.studentid=course.studentid;it gives me multiple records.my doubt is, when i get multiple records, and which is true(in the case a student has registered for multiple courses), how can i traverse through the resultset and fetch the values in the respective textfields.

View 1 Replies

.net - Given A Large Number Of Objects, Create Multiple Forms In Designer For Them Or Use Code To Create The Forms?

Dec 29, 2010

If I have a large number of classes, each similar to the other in certain aspects (they all share a common base class, but each does things differently), and I need to create Windows forms for each to allow easy changing of their values through a GUI? Create one matching form for each object in VS' forms designer, Or Use code to create the forms dynamically at runtime.

#2 makes the most sense to me, because a lot of these objects will share very common features of the form, notably "Ok" and "Cancel" buttons. But one object might need to draw a textbox on the form while another might need to draw a combobox. Not to mention, if I want to put icons on the "Ok" and "Cancel" buttons, I'd have to do this for each copy of the form in designer, and that sounds like it could get out of hand quickly.But is drawing forms through code sane? VS' forms designer is pretty sophisticated and designed to make life easier. Am I wise to consider ignoring its functionality and diving into the trench warfare of forms design through code? Or are there examples of automating form creation based on an existing object's properties?

View 1 Replies

Forms :: Passing Values Between Forms

Jul 23, 2009

My scenerio is a form with a button, when clicked opens a form dialog. The dialog allows the user to enter a text box. I want to read the value of the text box from the main form into a variable to be used with an SQL statement. The following code is used to create a new instance of the form dialog if one does not exist:-

[Code]...

View 2 Replies

Forms :: Use Index Of Objects In Vb6?

Nov 16, 2009

I would like to use index of objects in vb6 to upgrade into vb.net, I have seen some topic but I could not do it

For exmaple(in Vb6)
Public Sub Update_PriorMenus()
'This sub read amoun projects and display in menu.

[Code].....

View 5 Replies

Objects Set To Nothing After Changing Forms?

Dec 19, 2010

In form frmAddPlayers I declare and create an array of pictureboxes in the Load event using the code:

Dim
pbxPlayerJoined(7) As
PictureBox

[code]....

In the watch window the value of the pictureboxes is System.Windows.Forms.PictureBox. Later in the load event I start a background worker in form sfrmUSBDevice using the code:

sfrmUSBDevice.sReadWriteThread.RunWorkerAsync()

The background worker waits for user input and then calls a subroutine from form frmAddPlayers. The subroutine changes the image in the picturebox to indicate that the user input has taken place. However when the debugger returns from sfrmUSBDevice to frmAddPlayers the watch window shows that all of the pictureboxes have a value of nothing. Then when I try to change the image of the picturebox I get an "Object reference not set to an instance of an object" exception. It seems like when the debugger goes to the sfrmUSBDevice form and comes back to frmAddPlayers the objects on frmAddPlayers have lost their information.

View 5 Replies

Passing Objects Between Forms?

Aug 11, 2010

I'm translating a document management application from vb6. I want to program with good habits and technique, so I'm asking for your opinion really rather than just a solution.I have a decent understanding of OOP, but I'm not very experienced in VB at all. What I'm doing now is trying to figure out the best way to pass objects between forms.For example, in my initialization form, I have an object that stores a group of database connections. I need to pass this object around because reconnecting takes a significant amount of time. There are other objects such as user info and permissions.

Public Class Form 1
Dim DB = New DBobject
Public Sub Form1_Load

[code]......

View 5 Replies

Changing Visibility Of Objects Without Using MDI Forms?

Nov 26, 2009

Currently my program randomly removes words from a set of text and inserts textboxes below the text. The user can then enter his/her answers in the new textboxes. What I would like to do is set the program so the user can have two choices one being Easy and other being Advanced. Then when the user hits either button it brings up everything that is currently on the form. I'd prefer to do this without having to use MDI forms. I've had a hard time using the MDI forms and therefore would like to avoid using them. They way I was thinking this could work is all objects would remain invisible except for the 2 buttons and then when you hit one of them they disappear and everything else appears.

View 1 Replies

Forms :: Accessing Objects At Runtime?

May 24, 2010

I need to dynamically access a bindingnavigator, is this possible? I basically want to have code in my Base form which enables or disables it's descendant's menu buttons depending on access rights.

View 2 Replies

Forms :: Converting Strings To Objects?

May 6, 2010

Can you look at this code? It's a class module that I made so I can make our application more modular.

In the code there are 3 lines of code which have this as part of it: FormBrowseAttendance.ComboBoxLookupStudent.how I can change the coding to refer to this portion of code using these parameters:

pComboBoxName
pNameOfForm

I'm assuming these need to converted is some way but I don't know how to do it.

[Code]...

View 3 Replies

Forms :: Datagrid Bind Using Objects?

Jan 7, 2010

i created a class i invoke the class as object in vb.forms i want bind object(parameters) to datagrid when return as arraylist from methods in form_load. i want to bind arraylist to datagird in form_load.it will bind, the grid show all the parameter from arraylist.but i want few columns to bind from arrylist.here arraylist is convert from list from method.

View 1 Replies

Forms :: Displaying Objects On PropertyGrid

Mar 31, 2009

I am having a problem with objects that have other objects as properties on a property grid. Now when I display the object clsPropsFrame on the property grid, everything shows up as expected, except when I try to edit the x, y, or z of location which is of type clsPropsVec3, it ignores the change. What's strange is that when I type the vector in as a string (like "0, 16, 0"), it changes.

I have the following
'//////////////////Object Component///////////////////////////
<TypeConverter(GetType(ExpandableObjectConverter))> _
Public Class clsPropsVec3
Inherits ExpandableObjectConverter
Private refvec As TV_3DVECTOR
Public Sub New()
[Code] .....

I noticed that when I changed a component of clsPropsVec3, the property change in clsPropsFrame does not get executed. I tried making it fire of an event when a component is changed in clsPropsVec3, with the following additional
Public Property X() As Single
Get
Return refvec.x
End Get
Set(ByVal value As Single)
[Code] .....
But for some reason it ever fires off the ValueChanged event. So how can I make the sub properties of clsPropsVec3 work?

View 10 Replies

Forms :: Objects Not Displayed With Wav Sound?

Sep 6, 2009

With VB6 and VB9, I continue to have problems displaying images on a form while playing wav files (either by API call or by My.Computer.Audio.Play method).I set up a loop to display pictureboxes on a form (card images), with a wav sound file that is supposed to be played each time a picturebox is displayed. However the pictureboxes won't display until after the loop finishes and the sounds have been played several times in series:Example

For I = 0 To 3
picBox(I).Visible = True ' picBox is an object collection of pictureboxes
My.Computer.Audio.

[code].....

View 2 Replies

Forms :: Use The Database Objects From One Form To Another?

Jul 8, 2009

How can we use the database objects from one form to another? Eg. In my Login form a person enters his user-name and password & if it is correct, the code directs him to another form(Form2). Now in Form2 How will I get which person has entered in?

View 1 Replies

Relative Positioning Of Objects On Forms?

Aug 21, 2009

how to make buttons and other objects move to the center of the form and possibly grow in size when form is maximized and also move back to its position when minimized.

View 2 Replies

VS 2005 Ambiguous Forms / Objects

Jun 9, 2009

I was working on one of my forms, not doing anything crazy or out of the ordinary, just adding a control to the form. When all of a sudden vb became real sluggish and barely responsive, so I closed VS and restarted the computer. Got back into my project and now I can't open any form. Opening a form gives me <b>failed to parse method 'InitializeComponent'. The parser reported the following error 'Error HRESULT E_FAIL has been returned from a call to a COM component.'. Please look in the task lisk for potential errors.</b>.Error list sometimes contains 102 errors, and sometime just one that says I have exceeded the maximum number of errors. When it contains 102, every single one of the errors is <b> [Object/Form] is ambiguous in the namespace [Project] </b>.

I can't open any designers right now, every single one of them gives the failed to parse method error. If I rename, lets say frmAbout to frmAbout1, then I can see that form.There is only one of everything in Solution Explorer, no duplicates. There are no duplicates in the folder either. I can open the code for each form/object and see it just fine, and looks fine too. Code is not duplicated or anything.

View 2 Replies

Forms :: Retrieve Data From Sql Database?

Oct 20, 2010

How can i retrieve data from sql database and put the values in textboxes?

View 7 Replies

Retrieve Data From Databse In Forms?

Jun 10, 2011

I m entering information of each person in Employee Information form and saving it in MS Access database.Now i want to Show the data of each person Individually and the information of the next person will be shown on the next button click. to do this what shall i use a crystal report or windows form.

View 5 Replies

Retrieve Details From This Object 'on-the-fly' From Other Forms?

Aug 14, 2011

I have a Login class with a doLogin() method which is called from a Button.OnClick() event from my Login form.If the login is successful, I then instantiate a User Class with the users details (username, first name etc.).The problem is, I don't know the best way to store this User object .I want to be able to retrieve details from this Object 'on-the-fly' from other forms, Such as UserObj.getFirstName(). And then have the ability to remove the object for when the user logs out, for example.

I really don't want to have to pass the object around to every form that would need it. That seems unnecessary and I'm sure there's a much easier and logical way.If it was possible to store objects in My.Settings, then It'd be perfect, but you can't (i think?).

View 7 Replies

Forms :: Event Handling For Dynamic Objects?

Feb 3, 2010

I am trying to create a form where depending on what the user selects, they are shown a collection of images from the web. Depending on what they select there will be a different amount of images so each picture will need to be added dynamically.

I am able to create PictureBoxes dynamically however I'm stumped how to create event handling in order for each control to give a unique response.This is what I originally tried but I got an error..

Private Sub Form1_Load
For i=0 To 10
Dim picBox As PictureBox

[code]....

The error I got was

'AddressOf' operand must be the name of a method (without parentheses)

How ridiculous that you can't include arguments in your AddressOf! Can anyone shed some light on my situation (or knows a better way of carrying out my goal)?

View 2 Replies

Forms :: Making Objects Move Diagonaly?

Nov 11, 2009

Im trying to make a radiobutton move diagonaly, (Dont ask why a radiobutton, i did it in college last week) For some strange reason though I need another radiobutton just going across the screen in order for my diagonal radiobutton to move.I would like to develop this into a game like pong, when I have gone further into VB.

View 3 Replies

Forms :: Retrieve Data From Mdb And Display In Listbox?

Feb 4, 2009

i need to create one search box using textbox and the result will display on listbox.

I have textbox1 as inputbox, button1 as search button , listbox1 to display the value , Database1.mdb as my database.

View 3 Replies

Forms :: Create A Dynamic DataGridView From A List Of Objects?

Feb 6, 2009

I am relatively new to C# and winforms, although I have been using Java for years, so forgive me if im asking something relatively straightforward!I have a DataGridView, it needs to update regularly so I wish to provide a Collection of objects as its DataSource and NOT a database table.So far I have a List<MyObject> which will be constantly updated via a BackgroundWorker thread. I want my DataGridView to update when a change has been made to the List i.e. if the objects are resorted, added to or deleted from etc.Currently my DataGridView only displays the first object I add to the List, if I add more the DataGridView doesn't update to display the new objects added.This is a basic overview of how im coding it:

private List<MyObject> myList= new List<MyObject>();
myDataGridView.DataSource = myList;
Then my BackgroundWorker thread updates the list, e.g.

[code].....

View 4 Replies

Forms :: Objects - Cycle Through A Arraylist And For Each Item In That List

May 15, 2009

I want to cycle through a arraylist and for each item in that list I need to create a picturebox, label1, label2 each with specific name attributes

[Code]...

View 6 Replies

Objects/fields - Make Vb 2008 Connect To Web Forms

May 4, 2009

I wanted to ask you how I can make vb 2008 connect to web forms, fill them out & submit them all from vb 2008 objects/fields.

E.g. My vb form will have a gui that consists of textboxes, buttons etc... that will enter the data to web forms.

Here is Google accounts Sign-Up page & I want to automate the Sign-Up process: [URL]

Take a look at this Account Creator app. that automate sign-up & see if you can assist me on this: [URL]

All I need is for you to tell me how to connect to the fields on any webpage that I want from VB 2008 fields/objects to any Web forms fields/objects.

View 2 Replies

Creating Forms And Objects Through Code In The The Load Event Of Form1?

May 22, 2011

I've been working on creating forms and objects through code in the the load event of Form1, truthfully theres a few questions I have under this one category but to start I want to create a button click event that will check what button was pressed then set that button to a variable. I want the event to treat the button that was clicked like it was that buttons click event.Here's a shortened version of my code (Lol if you can call this short):

[code]...

View 3 Replies

Forms :: Handling Events From WebBrowser Objects Contained In An ArrayList?

Jul 18, 2009

I'm writing a tabbed web browser for someone who is learning VB.NET, and I have got to the point where I can add/remove browser controls into tab pages, controlled by one set of buttons on the main form, but I can't handle events from the WebBrowser objects.I have tried this but it says that 'DocumentTitleChanged' isnt an event of 'Control'...

Dim browser As New ArrayList
browser.Add(New WebBrowser)
browser(0).parent = TabControl1.SelectedTab
browser(0).dock = DockStyle.Fill
AddHandler browser(0).DocumentTitleChanged, TitleChangedHandler()

I want to update the tab title with the web page title when it changes. I started using a timer to update the tabs but there must be a way to add an event handler here.

View 2 Replies

Sql - Save And Retrieve Image In Database From PictureBox Control In Windows Forms?

Mar 21, 2012

I am having trouble in browse & then save an image to SQL Server.ALso I want to retrieve that image.This is the code to browse image & show it in PictureBox1 Control

Public Sub SelectImage()
With OpenFileDialog1
'.InitialDirectory = "C:"

[code]....

But don't know how to pass it to image parameter .Also is there any way that I can save image on Local drive & just save the url /location/name in database?

View 2 Replies

System.Windows.Forms.WebBrowser - Retrieve Post Data After Navigating?

Mar 3, 2009

I'm instantiating a WebBrowser object and programmatically clicking a button to navigate. Is there a way (property, method, or voodoo ritual) for me to check the browser after it lands on the new page to see 1) the form method that was used and 2) the post data?

View 3 Replies

Asp.net - Passing Values Between Web Forms?

May 1, 2011

Im trying to pass a value of a date control from form1 to form2.on form 1.aspx.vb:

Public ReadOnly Property Property1() As Date
Get
Return StartDate.SelectedDate[code].....

Tried to assign the property to a string, it did not work either.

View 2 Replies







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