dismal
dismal
CC#
Created by dismal on 11/3/2024 in #help
Form TopMost switching
So I'm making a sort of custom desktop to bring some mobile like features (like app folders and widgets) to windows, and I have each widget as a Form. I need the widgets to be always on top of the desktop, but never on top of any other windows. I don't know if this is just a mental problem, and it's in fact really easy or it's just difficult to implement in general.
5 replies
CC#
Created by dismal on 9/20/2023 in #help
How do I fix 'Object reference not set to an instance of an object.'?
I have an app that you can change the background in. The background of a panel in Form1 is set with this function:
public void SetPanelBackgroundImage(Image backgroundImage)
{
Form1.back_panel.BackgroundImage = backgroundImage;
}
public void SetPanelBackgroundImage(Image backgroundImage)
{
Form1.back_panel.BackgroundImage = backgroundImage;
}
back_panel is set to Public so it can be accessed from my other form (UC_tab_theme.cs) and Form1 is instanced from
Form1 Form1;
Form1 Form1;
The parameter that I pass into my SetPanelBackgroundImage() function is Properties.Resources.blob_scene_haikei which is a valid path to the image. I get error:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=ProtoSploit
StackTrace:
at ProtoSploit.res.UCs.UC_tab_theme.SetPanelBackgroundImage(Image backgroundImage)
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=ProtoSploit
StackTrace:
at ProtoSploit.res.UCs.UC_tab_theme.SetPanelBackgroundImage(Image backgroundImage)
I'm new and I don't particularly understand c# yet, so I hope one of you can help.
5 replies