This is my first Windows app to create since VB6. I've been in the world of ASP and ASP.NET for many years. However, now I have been asked to create a simple app that needs to be windows based.
I am trying to do a runas command but it will not let me pass all the variables instaead it brings up a command prompt asking for a password how can I wait for the command prompt to come up and pass the command variable to the console? variable I need to pass is aPwd
in form 1 -> 1 button in form 2 -> 1 textbox and 1 button
when I click button in form 1, it will show the form 2..how can i pass the variable (data from textbox in form 2) into a variable in form 1 after clicking the button in form 2 ?
Passing data between forms without any public methods or properties on the forms. everything but the "Controller" class, which I would like you furnish. I just changed the title from "Intermediate" to "Beginner" This solution is an example of the Observer Pattern. The "Controller" class is the "observed" class, which in this case means it publishes events.
' File Definitions.vb
Public Delegate Sub MessageDelegate(ByVal sender As Object, ByVal e As MessageEventArgs)
Public Class MessageEventArgs : Inherits EventArgs Public Message As String
[CODE]...
The program should initially display Form1, and Form2. Clicking of the button on either form will modify the Title Text of both forms. I think that you will find the final end result to be pretty neat, as it works with any number of open forms not just two. I think asking for the Controller class is easier than asking for the code in the forms. My solution for Controller class has 7 lines of content, 9 lines if you include Class, EndClass. A minimal solution could achieved with only 4 lines of content, but it would a textbook example of bad programming.
I am using a function that is provided by the maker of an IO device that I'm using and the call for this device turns on and off the 16 ports on the IO device by sending the value true or false to the board. The call is as follows:
Dim Selvk As New Selvkost2 Selvk.PassedText = TextBox29.Text Selvk.Show()
[code]....
in my second form and the text passes. but I need to pass values from 20 textboxes. do I have to copy the code in my second form 20 times an declare passedtext2 and so on or is there an easier way to do this?
I have a variable that gets a value in a js function. I need to get its value as a double into a vb.net variable. I have tried putting the variable into a label then grabbing it from the label in vb.net as shown in the code below:
Dim SecondName As String = SecondNameTxtBox.text()Is the above statement a correct one?Here I want to assign the value of the text box into tat "SecondName".If it's wrong, please tell me the correct way to write this statement.
Not sure how to do this sub that passes a variable that is used in a Dim. fill_in_field("main_form.WebBrowser1") Sub fill_in_field(ByRef WebBrowser As String) Dim ElementCollection1 As HtmlElementCollection = WebBrowser.Document.GetElementsByTagName("input") End Sub Dim ElementCollection1 As HtmlElementCollection = WebBrowser & "Document.GetElementsByTagName("input")"
This is what I would like. Dim ElementCollection1 As HtmlElementCollection = main_form.WebBrowser1.Document.GetElementsByTagName("input")
I want to know if it's possible to retrieve the variables name from when it was passed into a certain function. For example, if I call parseId(myId) to a function with the signature parseId(id), i can obviously retrieve the value of 'id'. However, is there any way I can retrieve 'myId' as a string (without passing it as another value)? Specifically in vb.net, but I'm interested in how it would work in any given language.
I have a public variable that I declared in form1 of an application. I am trying to call that variable in form2 and then pass that variable in a sql query. If I declare:
Public Class Form1 Public payPeriodStartDate, payPeriodEndDate As Date
How then to I declare that variable in form2 and how to I pass it to my sql query.
Here is the code I have for form1: [Code]
and when I debug this form, no data will appear. I'm sure that it's something wrong with how I'm either calling the variable in form2 or in the query. Can anyone offer any assistance on this?
I have 2 dropdownlists, one is State and the second is City. I am trying to create it so, when a user clicks the State, the second dropdownlist is populated with City names from a datatable.[code]
passing a variable to a sub procedure by reference. Not sure I understand how it works. Here is the code.
Private Sub bntcompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntcompute.Click Dim x, y As Double getnumbers(x, y) displaysum(x, y)
[code]....
Is the newly modified variable actually being Passed back? and If so where in the statement is it passed back. is it being passed back to the call getnumbers or is it passed back to the statement displaysum?
I'm using MVC2 with jquery.I'm trying to open a partial view in a jquery Dialog container, passing an itemID of an object to be deleted.What I'm doing to accomplish this is passing in an action that renders a view to jquery, which I can get to work without variables.f I try to pass in the ID of the object to be deleted, the action doesn't even trigger.
Here's my jquery code: $(function () { var itemToDelete
Doing a small project where I would like to be able to print the results of certain calculations. I want to open a new form where the data can be neatly presented and printed. I just can't seem to make the data get passed along to the new form when I open it..
I have a useform set up to have a user input value, and I would like to pass that value to a module. I have made the variable public along with the subroutine that I am trying to use the variable in. I have a message box display the value of the variable in the subroutine and the value is 0, even though I have inputted a value in the userform.
[YearForm] Option Explicit Public Sub UserForm_Click() Me.intYear.Integer = Year Module1.OpenFile Year [Code] .....
I have a form with a list box. I'm calling it as a dialog. I can get the result of which button was pressed (OK/Cancel) but how do I get the value chosen from the list?
Dim frmCreateCSVFile As New CreateCSVFile frmCreateCSVFile.dtpFirstEndDate.Value = dtpFirstEndDate.Value frmCreateCSVFile.dtpLastEndDate.Value = dtpLastEndDate.Value
I use VB .NET 2002 (academic version) I have created an MS Access database to be populated with vaules extracted from dBase files. Some numerical values can be null - ie where no data was recorded in the dBase file. Relevant field properties in MS Access mdb table are set to "Not Required" as follows - dt0 is the name in code of the Access table "AllData":
With dt0.Columns .Append("Date", DataTypeEnum.adDate)
colTest.Name = "Ch1Deg"
[CODE]...
Using an INSERT INTO command I can send a null value to the field:
My problem is how to pass a variable which sometimes takes the value System.DBNull.
If I use SQLMdb = "INSERT INTO [AllData]" " ([Date],[Ch1Deg])" & _ " VALUES ('" & dDate1 & "','" & dDeg & "')
Then when dDeg is numeric then there is no problem and the table is populated. When data is missing and dDeg takes the value System.DBNull then it's a no go! The error message is "Data type mismatch in criteria expression."
Is there a way round this with VB .NET 2002 or do I need to upgrade to a later version which has nullable data types, eg nullable integers and doubles etc?
Is there a way to call or pass a variable to another sub? I'm trying to reterive a variable (or even a field name) in somethign like this:
Private Sub PrintPageHandler(ByVal sender As Object, ByVal args As Printing.PrintPageEventArgs) args.Graphics.DrawString(RS("field1"), New Font("arial", 8), Brushes.Black, 5, 5)
I am trying to work with classes and variables and don't seem to understand some behavior that is going on.
first off the class Public Class csSession Public ID As Integer Public Name As String End Class Usage and behavior (example code) Dim S1 as new csSession Dim S2 as new csSession S1.ID = 1 S1.Name = "1st Session" S2 = S1 S2.ID = 99
When I assign S2 = S1 all the values of S1 passes to S2 but also there is a "link" or bond between the two variables now. If I change the values of S2 this automatically changes the values of S1!! Why does this happen and how can I prevent it? I just want to pass the variables values contained S1 to S2.
With the code below data is keyed into a form and inserted into a table called Investors.After it is inserted, I'm trying to redirect back to the same page, passing the InvestorID on the querystring. Simply showing all of the information I just added, kind of insuring that it was posted to the database.
Code: Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click