creating a Form Having Return Value
-
I want to create a form such as a dialog box or a user control having return value how can i do it (for creating a dialogbox such as inputbox i defined a public variable and in fact i did not have return value but i save return value that user enterde in the my inputbox in this public var) thanx for your helps
-
I want to create a form such as a dialog box or a user control having return value how can i do it (for creating a dialogbox such as inputbox i defined a public variable and in fact i did not have return value but i save return value that user enterde in the my inputbox in this public var) thanx for your helps
Best way to do it is to set a public property or variable. There are no return values such that your see in a Function statement. RageInTheMachine9532
-
I want to create a form such as a dialog box or a user control having return value how can i do it (for creating a dialogbox such as inputbox i defined a public variable and in fact i did not have return value but i save return value that user enterde in the my inputbox in this public var) thanx for your helps
Calling a Form using the ShowDialog method, you can return a DialogResult value. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
-
I want to create a form such as a dialog box or a user control having return value how can i do it (for creating a dialogbox such as inputbox i defined a public variable and in fact i did not have return value but i save return value that user enterde in the my inputbox in this public var) thanx for your helps
you can make a function is a module that shows a form as modal and returns the value from it.
-
you can make a function is a module that shows a form as modal and returns the value from it.
You can use a Shared Variable in the form class that will hold the value to be returned. "I think there is a world market for maybe 5 computers" Thomas Watson, chairman of IBM, 1943 "There is no reason anyone would want a computer in their home" Ken Olson, chairman & founder of Digital equipment, 1977 "This 'telephone' has too many shortcomings to be seriously considered as a means of communication. The device is ingerently of no value to us." Western Union internal memo, 1876 "640 K ought to be enough for anybody." Bill Gates, 1981 "Computers in the future may
-
you can make a function is a module that shows a form as modal and returns the value from it.
Hi Tanx but I couldn't undrestand what u mean please descibe your solution.:)
-
Hi Tanx but I couldn't undrestand what u mean please descibe your solution.:)
create a form (frmMessageBox) and a module (mdlMsgBox) in the mdlMsgBox create a Function :
public function MyMsgBox() as integer frmMessageBox.Show vbModal MyMsgBox = frmMessageBox.ReturnValue end function
where ReturnValue is a public Get property (read only) of the form.
-
you can make a function is a module that shows a form as modal and returns the value from it.
Hi Tanx but I couldn't undrestand what u mean please descibe your solution.
-
Hi Tanx but I couldn't undrestand what u mean please descibe your solution.
Try this 1st dim your second form from your main form. 2nd In the second form user will enter data into any object (text rdo...) 3rd exiting the form will be "me.hide". 4th control is then back to the main form at which point you can read the values that are in the objects of the second form. ex; Dim findEntry As New frmSearch findEntry.ShowDialog() 'Form is shown. Used to set variables for search If findEntry.DialogResult <> DialogResult.Abort Then ' Do search when true, = Abort when cancel btn clicked sSearchText = findEntry.txtSearchText.Text sSearchItem = CStr(findEntry.cboItems.SelectedItem) findEntry.Close() sSearch is a variable which is assigned the value from the second form. Last step is to close the second form.
-
Try this 1st dim your second form from your main form. 2nd In the second form user will enter data into any object (text rdo...) 3rd exiting the form will be "me.hide". 4th control is then back to the main form at which point you can read the values that are in the objects of the second form. ex; Dim findEntry As New frmSearch findEntry.ShowDialog() 'Form is shown. Used to set variables for search If findEntry.DialogResult <> DialogResult.Abort Then ' Do search when true, = Abort when cancel btn clicked sSearchText = findEntry.txtSearchText.Text sSearchItem = CStr(findEntry.cboItems.SelectedItem) findEntry.Close() sSearch is a variable which is assigned the value from the second form. Last step is to close the second form.