Hi ALL
I have some conceptual questions for the program that I have converted from VB6 to VB.net is working but there are elements of it that I really don't "see".
I have a form with two picture boxes; picture1 and picture2; picture1 is a much smaller picture box that is totally contained by picture2.
The program via a textbox captures the name of a disk image file (TIF) and transfers that file to picture1 by way of the following 2 commands
Picture1.SizeMode = PictureBoxSizeMode.StretchImage
Picture1.Image = Image.FromFile(fileName)
the disk file image is transferred and expanded to the dimensions of the picture box picture2!
What mechanism stretches the image to the dimensions of the picture box picture2 when it is transferred to picture1?
This image transfer happens in the textbox_leave event; but the "picture2_paint" event (which presents the image) does not fire until the textbox_validating event is exited?
What I would like to understand is why did the original programmer use this picture1, picture2 choreography; is this inside, outside picture box relationship the "mechanism" that provides the correct display size; why does the picture2_paint event fire when picture1 is assigned the image and lastly, why does the picture2_paint event wait for the textbox_validating event to be exited before it fires.
My education is in need of updating. Any help would be greatly appreciated.
I have some conceptual questions for the program that I have converted from VB6 to VB.net is working but there are elements of it that I really don't "see".
I have a form with two picture boxes; picture1 and picture2; picture1 is a much smaller picture box that is totally contained by picture2.
The program via a textbox captures the name of a disk image file (TIF) and transfers that file to picture1 by way of the following 2 commands
Picture1.SizeMode = PictureBoxSizeMode.StretchImage
Picture1.Image = Image.FromFile(fileName)
the disk file image is transferred and expanded to the dimensions of the picture box picture2!
What mechanism stretches the image to the dimensions of the picture box picture2 when it is transferred to picture1?
This image transfer happens in the textbox_leave event; but the "picture2_paint" event (which presents the image) does not fire until the textbox_validating event is exited?
What I would like to understand is why did the original programmer use this picture1, picture2 choreography; is this inside, outside picture box relationship the "mechanism" that provides the correct display size; why does the picture2_paint event fire when picture1 is assigned the image and lastly, why does the picture2_paint event wait for the textbox_validating event to be exited before it fires.
My education is in need of updating. Any help would be greatly appreciated.