VB 6.0 - Pass an Image to main Form

Asked By Mercedes Blanch
03-Feb-12 02:01 AM
 I have Form2 with some images.  When user selects one (from the several options there are) and clicks a command the main form should open and the image previously selected on Form2 must be displayed on my main Form.  So far my main form opens but I do not know how to display/pass the image previously selected.  How can I do this? Please help!   
  D Company replied to Mercedes Blanch
03-Feb-12 02:05 AM
hello Friend.

on Main form, create object of Form2. and check the condition for selected image, suppose if you have taken a checkbox for this.

Form2 objform2=new Form2();

objform.urcheckbox and check for whether it checked or not.
else loop through all the check boxes on this form and fetch the appropritae one.

let me know if nee more help on this
Regards
D
  Reena Jain replied to Mercedes Blanch
03-Feb-12 02:17 AM
hi,

To pass the data from 1 form to another form you need to use static variable in class and then by class name you can access them any where in project for get or set the value. here is the sample code for this

in class at global side
public class myclass
(
public string usernm, password;
}


on login form

myclass.usernm=TextBox1.Text;
myclass.password=TextBox2.Text;


on other form where want to access
textbox3.text=myclass.usernm;
TextBox4.Text=myclass.password;


hope this will help you
  Mercedes Blanch replied to Reena Jain
03-Feb-12 02:23 AM
I could try what you say but not sure how to declare a public class in VB6.0 neither make global IMAGES as global variables :-(

  Mercedes Blanch replied to D Company
03-Feb-12 02:28 AM
Thank you for your help but I will need a deeper explanation.  Plus Im working on VB6.0 which Im afraid it does not support characters such as ";"...
Create New Account
help
Syntax for friend template classes? C++ / VB I have a template class and want to declare another template class (of the same shape) as a friend. This seems to work: template<class C> class bar; / / forward declare template<class C> class foo { friend class bar<C> ; }; but it is annoying that I have to
can't i declare class type variable inside its declaration C++ / VB cannot i declare class type variable inside its declaration for example: class A{ int var; A a; A b; A *p; } - - [ See http: / / www.gotw.ca / resources must have its own a . . . You can have a pointer or a reference to the class because neither of those needs their own instance variables. - - [ See http: / / www.gotw.ca / resources First time posters: Do this! ] You can make a pointer to an instance of the class you are defining, but you cannot make an instance of the class within the class
App_Code & bin .NET Framework Is putting a VB class file in the special directory named App_Code the same as relocating the VB class file from the App_Code directory to another directory & then using the VBC tool, compiling the VB class file into a DLL & putting the DLL in the bin directory? Though while running an t make any difference, Visual Web Developer 2005 Express Edition behaves erratically sometimes if the VB class file resides in the App_Code directory & the corresponding DLL doesn't exist in the bin
Protected Class .NET Framework All, For my knowledge, if I declare Class as follow, then it thows compilation error. Protected Class Book End Class Even same for. . . Protected Friend Class Book End Class As per my search, class that has to be declared with Protected, should be declared within other class. Any suggestion
Implicit Typecast Operator Overloading? .NET Framework Hello - I have the following scenario . . . Class cBase End Class Class cChild Inherits cBase End Class Then there is a function that returns an instance of cBase() . . . Function getStuff() As cBase done in .NET 2.0 2008. Is there any way to do that? Thanks, Joe VB.NET Discussions Console.WriteLine (1) IDummy.getStuff (1) VB (1) LFlightPlanSnap.getStuff (1) Console (1) LFlightPlanSnap (1) From a non technical point of view guess I oversimplified the actual problem in my example. Here are a few more details . . . Class cA Class cParent End Class Dim mParentInstance As New cParent Public Overridable Function getStuff() As cParent Return