Assign Form1 Control To A Form Object?
Mar 3, 2009think i have 2 form & one module..
form1 (has one button name button1)
form2 (also has one button name button1)
[Code]....
think i have 2 form & one module..
form1 (has one button name button1)
form2 (also has one button name button1)
[Code]....
I am trying to assign values to controls in another form and I created a procedure(sub) to do this I was using myOtherForm.Label1.Text = "Value" but it is giving me an error saying expression does not produce a value
View 1 RepliesIn my window application, Form1 variable eg. Public str as string. value blank/null when move to Form2 and Back to Form1. How to maintain Form1 varable's value when back to Form1 In vb.net if any one know, reply me soon
View 2 RepliesI have a solution with several Projects in it. There is a Windows App project (called ImportClient), and a Class Library (Import.Library). The Import.Library has functions to perform data imports (I have other applications in the solution that also need to call it). But the interactive application, I want to be able to pass in some form controls, and have it update the GUI. No problem. But, I also want to execute a DoEvents() so that the loop execution doesn't hang other interaction to the app.
So, ImportClient has a reference to Import.Library. But I can't add a reference to ImportClient to the Import.Library, because the compiler complains about circular reference, etc. I don't know how else to define the My.Application object of ImportClient as a parameter to the data function in ImportLibrary.
(I realize this is a dumb question - problem is, for this project I have a tight timeline, and haven't learned how to do the BackgroundWorker process. If you think I could pick it up quickly, I'm open to some hints about how to update the progress bar on the GUI, and how to pause / cancel the background task.)
Am trying to debug an application written by someone else. The issue is we get an "Out of Memory" when executing the following code
[Code]...
Admin assigns the authority and get a new form to the new assign in with vb.net & access. I am not sure about this,I need a way to do the new form assigned? How?Actually, this project is the admin will assign the authority to a manager, and the manager will get the password to log in. Then, the manager once log in and will get a form to set the rooms who is going to use and date, etc, this is multi-manager to handle the room setting jobs.But, I think, I got stuck, I am not sure how to do the new form, HOW DO YOU ASSIGN THIS NEW FORM FOR EACH NEW MANAGER?????? THIS IS VB.NET WITH ACCESS.
View 3 RepliesSo the application I'm writing code for is this:
A fancy bed and breakfast offers the following, though somewhat usual, rate structure:
Single room $150 per night
Double room $175 per night
Family room $200 per night
Suite $ 250 per night
The bed and breakfast also offers the following meal plans
Breakfast only $10 per day
Breakfast and lunch $15 per day
Breakfast lunch and dinner $25 per day
Create a VB 2008 application with two forms. One form holds the room type (Single, Double, Family and Suite), and the other holds the meal plans. The user should select a room type and a meal plan, and the application should show the total charges multiplied by each day the user stays at the bed and breakfast. So far I've created one form with Bed plans and the second form with meal plans. First form has a continue button so that I can load second form and the code for that event is:
Dim SecondForm As New frmSecondForm
SecondForm.Show()
Then I've meal plan choices in second form and a text box for number of nights and a display cost button. So when I click on Display cost button, I want to be able to add the bed plan into total cost. How do I connect these two forms?
If I create a new form, say Form2, in order to use it in a program I must create an instance of it: Dim frmTwo and new Form2, If Form2 has a text box on it I can put this code in Form1: [Code] But what happens if I want to refer to an object (a text box)in Form1 with code in frmTwo? This doesn't work: [Code] How is the instance of Form1 created? And How do I refer to it?
View 3 RepliesI am Visual Foxpro Programmer and moved to Vb.Net.
In Foxpro for each control I add to the form, there is a method called Init where this is executed only once when the form run.
I am doing the code for a control in the Form_Load and things working fine.
I am Visual Foxpro Programmer and moved to Vb.Net. In Foxpro for each control I add to the form, there is a method called Init where this is executed only once when the form run.
View 2 RepliesI am writing this codes on classlibrary to make the changes of the text and I want to control the form as well. I have wrote the last if statement on the bottom of the code that if the form is on the right side, then set the form from righttoleft. I get an object reference which is not set to an instance of an object. Here is the list of the codes that I am writing to make changes of the text on each menu items and control the form. [Code]
View 5 RepliesI'm trying to assign a date object to nullable but my code error on CBDate1 = nullDate. The message indicates that I need to assign a value to a nullable. This is my first time using nullable[code\]...
View 9 RepliesI have an object, o, and a type, T. I'd like to use reflection to change object o to type T at runtime without instantiating it.The equivalent at compile time would be:
Dim p as Point = Nothing I know how to use Activator.CreateInstance to create an instance at run time that is equivalent to: Dim p as New Point()
But i don't want to do this. I have no knowledge of the type's constructor parameters and some types don't have a parameterless constructor. eg. Font. So, to sum up, I'd like a way of performing the equivalent of: Dim o as T = Nothing
In case you're wondering why I'm doing this, it's because I'm using a PropertyGrid on a form to edit types. If this is the first time for editing, say, a Font, then passing an uninitialised Font to the PropertyGrid makes the grid display the default values.
I tried 'o = GetUninitializedObject(T)', but the PropertyGrid either wants a properly initialised object or an object, with a defined type, set to nothing.
I've actually solved my particular problem here: how-to-use-the-property-grid-in-a-form-to-edit-any-type
, but i'd still be interested to know how to assign a type at run-time without the use of a wrapper class (which I was lucky enough to be using).
I'm trying to assign a date object to nullable but my code error on CBDate1 = nullDate. The message indicates that I need to assign a value to a nullable. This is my first time using nullable.
[Code]....
I am passing value via an object property form1 to form2 my class was working before, but I guess when i create the instance of the form2 in form1 my calls in my class no longer work properly.
[Code]...
I am trying to assign some letters to some buttons using visual basic 2008 or 2010 beta.What code would be used to do this: if the button 'a' is pressed the lets say button21 clicks.Sorry if this was allready in the forums, but i tryed allready like 4 methods and dont unterstand how these work.I know how to program in c++ and i am trying to move to vb.
View 6 Repliesi would like to assign my array vals to properties of my object.
like:
For i = 1 To 32
myClass.Prop_i = val[i]
Next
I'm making a little program in where i'm trying to invoke a method from a class dynamically with so called Reflection.
The class I'm trying to call is called ContactList and i try to invoke the property in this class called count. The assembly itself is called Contact.Exe
Now I have the following code where I make an instance of the ContactList class in the Contact.exe assembly:
[code]...
Im doing this project but u have a problem. im trying to make it so that when a timer in the first form(form1) ticks a progress bar in the other form goes up by 1.
View 2 RepliesPrivate Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Para abrir un formulario independiente /Open independent form
[Code].....
I want to insert a Windows Media Player object in my Form, but I have not the control on my Toolbox.
I have done the steps:
Right-click
the Toolbox -> Choose item -> COM Components -> add Windows Media Player component
(which references to C:WindowsSystem32wmp.dll)
But there is not the control on my Toolbox.
In my project references I see "MediaPlayer" into "Imported namespaces" and it is checked. In the references window it is also present "Windows Media Player". Where is the error?
So if I create an object test, and it has a property color. When I add this object to an array list I typically can access this using myarray(0).color but intellisense doesn't 'know' that I have a 'test' object inside the array. It would let me type myarray(0).whatever but would then crash if I made typo. It seems like I should be able to let it know what type of object I am trying to work with inside the arraylist. In code maybe something like this
[Code]....
so going through some code to clean it up instead of having:
vb
Form1.TextBox8.Font = New Font(Form1.TextBox8.Font.FontFamily, 12, FontStyle.Regular)
[code].....
Using VB 2008:Situation: A Form1.BackgroundWorker calls a Form1.subroutine. That sub starts a Form1.Timer with Me.tmrOK_BlinkForm.Enabled = True...fires Timer code in event: Public Shared Sub tmrOK_BlinkForm_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrOK_BlinkForm.Tick
Form3.Visible = True
Form3.Label1.Text = gNowButtonDispText
Form3.BackColor = Color.White
Form3.Refresh()
[Code]...
There must be a way to do this, I just need the correct BackgroundWorker Syntax send Stop commad to Form1.Timer from Form3.Click_event...all inside a Form1.BackgroundWorker thread started in Form1.
What I'd like to do is position Form2 underneath the Label on Form1 when the "down arrow" button is clicked. (Basically Form2 should have the same "Left" as the Label on Form1, and its "Top" should be the Top of Label1 plus the Height of Label1.) Please see attached images for further clarification. (I did something like this in VB6 with the SetCursorPos API and the Screen.TwipsPerPixelX and Screen.TwipsPerPixelY properties, but I'm sure there is a better way to do this in .NET.)
View 7 RepliesI have got 2 forms ----- form1 and form2
i wanted to navigate from form1 to form2. and then close form1
i did the following code.
-sub form1 _ page load
dim form as new form2
form.show()
me.close
-end sub
i also tried -- form1.close() and form1.dispose() but all in vain
Problem is that my form1 is not getting closed
I have an aboutbox1 and form1..I also have a button. When I click the button it runs the backgroundworker. My background worker then opens form1.My backgroundworker doesnt just open it, it does alot of other stuff so don't ask why im doing it like that.My problem:When the background worker opens form1, form1 is not responding.
View 3 RepliesI have created a CustonControl (NOT a usercontrol) and defined a DependencyProperty as following
[code]...
Well i meant In Form1 theres an object named NUM in which i have Stored Few values Now i want to use this Object NUM in form2 so that i can display its value in Form2.. ima unable to access it in form2.
View 6 RepliesI'm trying to assign a datasource to a ComboBox control during runtime. When I do so, I get the attached message. Here is my
cmbAddressDesc.DataSource = dbDataSet4.tblAddressCodes.addrDescColumn
dbDataSet4 is a typed dataset. I want to learn how to use an Interface. The error message is suggesting using an IList. How would I do this. I'm having trouble finding good documentation on this.