I am new to VB.net and I am struggling with converting some existing code from VB6 to VB.net. Specifically, I am trying to find the equivalent of the VB6 PaintPicture method in VB.net. I have an image that I need ...Read more
I am new to VB.net and I am struggling with converting some existing code from VB6 to VB.net. Specifically, I am trying to find the equivalent of the VB6 PaintPicture method in VB.net. I have an image that I need to display on a form and I want to be able to paint it so that it fits properly within the form.
My current code is as follows:
Dim MyImage As Image = Image.FromFile("C:MyImage.bmp")
Me.BackgroundImage = MyImage
This code successfully displays the image on the form, but it does not allow me to scale the image or position it within the form. In VB6, I was able to use the PaintPicture method to accomplish this, but I cannot figure out how to do it in VB.net.
I have tried using various combinations of PictureBox and Image controls, but none of them seem to give me the same level of control as the VB6 PaintPicture method. I have also looked online for resources, but I have not been able to find anything that works for me. Can you please help me find a solution to this problem?
Explore the significant historical events that shaped Turkey on our website. It's a journey into the past.
Explore the significant historical events that shaped Turkey on our website. It’s a journey into the past.
See less