Background image not showing in winforms - vb.net

Check this link this is exactly what my problem is..
At Form_Load:
Me.BackgroundImage = My.Resources.black_gradient_background
I even deleted back color property at designer, it reverted to default, but..
still...
But the image is there, I can see it when loading the form, then it disappears, its like in the back. Why is that? I tried to create new form, added that background image, its working fine. What did I do? >.<
UPDATE I tried Restarting VS, did it to another form. look what happened:
The BGimage only appeared on the left groupBox. O_o

Try changing form layout from RtoL to LtoR

As Hans says you are blocking the image with other controls, you need to set the other controls that you want the image to show through as transparent Control.BackColor = Color.Transparent.

Related

Text field problems Xcode

I’m creating an app and need to make a signup/login page. I added a background using a picture and a zstack and on top I have the text and text fields. The text fields are showing up but not allowing me to add padding as well as there is no title text showing. Please help.my code
Did some more testing to find out that this happens whenever I use a textfield over an image. Not sure if this is a bug or not but it seems to be because as soon as the zstack is removed everything works.
At last ive discovered the issue, the text fields are extending way out of the canvas. Ive fixed the width of the textfield as a temporary solution but still looking for a way to fix this relative to the screen rather than the background as the field extends to the size of the image. Let me know if you can help as im just starting to use xcode!
I think its because the image cause canvas to be much more bigger and you use edgesIgnoringSafearea(.all)
Try to use on the image clipped() method and i think it will fix your issue with the padding.
And also try to add foregroundColor to the test fields

Empty WebBrowser with no background in VB.NET

I'm facing a strange issue. I've add into my VB application a WebBrowser without made any further change on it. And when I run it in order to display a web page like "www.google.com", instead of the white background, I can see the window behind. It's just like the white color is fully transparent. I've try to add a screenshot to this topic but I don't have enough "reputation" yet.
How can I remove this opacity behavior and have the default white background ? Do I need to initialize the webBrowser with white background color ?
Thank you.!
You've most likely accidentally set the TransparencyKey() of the Form to White. Clear that field and see if that fixes the problem.

How do I create an image button?

I'd like to display an image which acts as a button. This means that when I click on the image a mouseUp handler is executed.
image area does not have a mouseUp handler
the buttons seem not to have a property where I can assign an image to them.
You can add a mouseUp handler to an image's script, and it will be triggered when the image is clicked:
on mousedown
answer "hi"
end mousedown
You can give a button an image by setting it's "icon" property to the id of an image on the stack (you will generally then want to unset the 'opaque', 'threed', and 'shadow' properties in order to make it look pretty).
What David said.
Though "mouseUp" is introduced as a natural button-related handler, be aware that any object can have such a thing, including a field if it is locked, and there are even ways around an unlocked field as well. The important thing is to know that the language and its environment are far broader and richer than you might at first infer from the tutorials and lessons.
Craig Newman
You can assign icons to buttons. This solves all your problems at once.
Create a new image control, e.g. by importing an image using the File menu. Create a new button and set the icon of the button to the id of the image control. If you like, you can use another image control for the hilitedIcon of the button. Add mouseUp and mouseDown handlers to the button as desired.
If the image is too big, resize the button to make the image fit. Set the showName of the button to false or change the margins (something like 0,32,0,8) to move the text below the icon.

How to implement wizard control in VB.NET

In VB6 I have been using pictureboxes as containers a lot.
For example I put 5 pictureboxes onto a form, and as soon as the user clicked the "Next" button, I brought the next picturebox into the foreground.
This has been extremely convenient.
Now I am fighting with doing something similar in VB.NET.
My attempts were not really successful. A picturebox does not really hold my controls, they seem to jump out now and then, and I can not really make out on which picturebox a control is currently located since the picturebox is not opaque as in VB6.
Can somebody please tell me how to do this in a good way in VB.NET?
This sounds like a job for the Panel control
For your issues with panels that you posted a screenshot for. Your panel is within another container, that's why it's displaying strangely. Try clicking the panel and cutting it (ctrl-x) then clicking the form header, and pasting it (ctrl-p). That will ensure it isn't within another control as sometimes that can happen in a way that isn't exactly obvious (like how you can see the control borders in your screenshot).

Picture box goes blank

In VisualBasic.Net When I activate a picture box and then draw something on it, it draws and then immediately goes blank. Works fine when I re-draw it, but almost always messes up the first time I draw on it. This has happenned with several different programs, and the help file is no help.
Try setting the DoubleBuffered property
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.doublebuffered.aspx
If that's not it, please provide more info.
Usually, if you're drawing something on a picture box or on another control, you have to take over the OnPaint event, and you're responsible of persisting what you draw on this event.
Thank you Andrew, but no help. I'm using .Net Framework 1.1, which does not offer the DoubleBuffered property... it was new in 2.0.
Not sure what additional info to provide.. the code is 300 lines long. When a button is clicked, the code expands my form, makes two picture boxes visible (one on top of the other (the back one is for some graph labels), and then uses some graphic brushes and pens to draw a graph on the front box. There's some database activity and calculations going on in the background at the same time.
I assume you're using the standard PictureBox component. Do you draw in the Paint-Handler? If not then the PictureBox will just erase your painted stuff next time it's asked to redraw itself (erase background etc.).
Yes, I believe I am using the standard picture box.
By Paint-Handler, I assume you mean a [Control].PaintEvent Handler. No I'm not using an event handler to do the drawing... drawing my chart is not an event in itself, but part of a much larger response to a button click event.
If you are saying that having the drawing code be part of a separate and specific handler can solve my problem, than I guess I could raise an internal event every time I want to redraw the chart. But I Would rather just figure out what is causing the PB to redraw itself without being told to.
If you cannot use the DoubleBuffered than you can HIDE a second picture box. You do the drawing in it and once it's completed you draw back to the VISIBLE one. This way the process of drawing is done on the hidden one and the white/flickering will not be shown.