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


ADVERTISEMENT

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

.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

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

Forms :: Panel Offset Index Property?

Oct 19, 2009

I use drag'n'drop from a datagridview to a panel. The panel holds an array of objects (think rows) so that the items from the datagridview can be dragged to the different objects. I use the y-index from the top of the panel to define what object the item is dragged onto.This works great as long as the object is visible from the start. However, if I scroll down to an object and then drag the item from the dgv, it gets released on the wrong object, as the y-index doesn't take into account the number of pixels I scrolled down. So, what I need is (if it exists) the scroll offset property for the panel, i.e., the number of pixels that I scrolled down. (Then I can add this offset integer to the y coordinate on which the user drops his/her object.)

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 :: Handling Multiple Textboxes, As Per 'old' VB6 TxtBox(Index)?

Mar 13, 2009

In old VB6, I could set all txtBox controls when members of the same index eg.txtBox(0),txtBox(1) etc., to all do certain things in a couple of lines of code, eg.

Private Sub txtBox_GotFocus(Index As Integer)
txtBox(Index).SelStart = 0
txtBox(Index).SelLength = Len(txtBox(Index))

[code]....

View 2 Replies

Forms :: How To Load Listview Selected Index Value To Textbox

Jan 4, 2010

an anyone show me an example or source code of how to load the value of a selected index value to a textbox using onclick event?

View 1 Replies

Forms :: Remove Tab Index Functionality From Left/Right Arrows?

Apr 10, 2009

Im building a, lets say kiosk, that has only one form of input and that is a keyboard. I've got an up/down/left/right arrows and the enter button. I have a form that needs to have hundreds of buttons. I've arranged all my buttons in a giant grid and want the user to use the arrows to navigate through the buttons. The button that is 'highlighted', lack of a better term, has different colors so we know which button we currently are on. So when the user hits the down arrow the button below the current button gets highlighted. My issue is that when the user hits the left and right arrows the 'cursor' doesnt move left and right it moves up and down.

The left and right arrows follow the tabindex sequence.

View 4 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 :: Selecting Datagridview Cell Data In Reference To Row Index

Aug 6, 2011

I've been looking everywhere for an answer to a simple question, but i'm having issues, so i thought i'd join and post here. I'm having issues with a simple concept. I load information from a SQL database, and i want to add a 'Passport' link URL relating to column cells called 'name'. It basically selects the name, and inserts it into the link fields to be opened. But i cant find a way to work it. I thought i could do it with something like:

[Code]...

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

Forms :: Make ListBox5 Select The Index Of ListBox4 Selected Item?

May 10, 2009

i have this..

ListBox4.SelectedIndex = 0
Dim mrc As Integer = ListBox5.FindString(ListBox5.Items.IndexOf(ListBox4.SelectedItem))
ListBox5.SelectedIndex = mrc[code]....

What im trying to do is, Make ListBox5 select the index of ListBox4 Selected Item (The Matching Ones).. example:I have the files of the same in two listboxes,Then in ListBox4, it selects The first Item (Got that bit),Then it selects the item of the exact same string as listbox4 selected item to select in listbox5..

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

Forms :: Clear The Dgv When The User Blanks The Combobox Without Necessarily Changing The Selection Index?

Oct 25, 2010

I have just realised that ComboBoxes don't have a Change event. I have a combobox filled with a few items, eg. Bakery, Deli, Fruit & Veg, etc. Choose one of these items, all the related items show in the dgv. However, when I blank the text in the Combobox (press Delete key whilst Combobox has the focus), what event fires so I can blank the dgv? The combobox does not contain a Blank item. Even if it does, the Blank item only fires the ComboBox1_SelectedIndexChanged when the user scrolls down to, or clicks on, the blank value.

I want to clear the dgv when the user blanks the combobox without necessarily changing the selection index.

View 3 Replies

Forms :: Find A Method Of Looping Through A Listbox And Retrieving The Index Number And Values?

Mar 24, 2010

I need to find a method of looping through a listbox and retrieving the index number and values - quite straightforward in asp, but turning out to be something of a nightmare in winforms!Here is the scenario - The user can add values in a textbox, that are in turn added to a DataTable that gives it a unique ID and a row number, this is then bound to the listbox. The user can then move the items up or down the list by adjusting the row number in the datatable and rebinding to the listbox..

The problem that I am hitting is when the user needs to delete an item -the first part is easy - delete from the DataTable and rebind to the listbox. The bit where I hit the proverbial brick wall is needing to loop through the listbox rows and getting both the index number and the ValueMember - that way I can change the row numbers in the DataTable based on the index number against the ID number.

View 4 Replies

Sql - Unable To Find Specified Column In Result Set Index Out Of Bounds Index Out Of Range Exception

Apr 23, 2012

i am having trouble putting a value in a textbox. Each time a ticket is sold i put the total price in a textbox, each time a ticket is sold for the same concert it increases by adding its self to the total price. It works at the first sale, but after that it breaks down. here is the code

Private Function DisplayMoneyTaken() As Integer
Dim totalMoney As Integer
'open the database connection

[Code].....

View 1 Replies







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