Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Parameter not valid on form resize?

I'm really not sure what's going on here but an application I've been working on for a while, I just noticed, throws an error when the form is minimized then re-opened.
I can't for the life of me figure out what's causing this so I'm posting here as sort of a last resort. Anyone know what's going on or have any sorta ideas?
The error throws up on the Program.cs on Application.Run(new Form1());
Here's a copy of the stacktrace
Code
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
at Theme.FaderComboBox.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ComboBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Edit: solved, I guess there was an issue with the dll I compiled the theme into. Thanks for all the help!
That stack trace isn't worth much if you don't share the event code for form redraw. That's probably what's triggering the error. Are you using a theme?
(Jul 4, 2020 05:12 PM)Roses Wrote:  That stack trace isn't worth much if you don't share the event code for form redraw. That's probably what's triggering the _error_. Are you using a theme?

I am, I'm using the FaderTheme compiled as a dll.
Quick google search brings this back for a vb.net version of it. I've had it compiled and saved for ages so I'm not 100% sure if this is the same exact code I'm using or not tho.
https://pastebin.com/TTZPRGyD

Edit: Turns out I do still have the original code. I uploaded it here. https://pastebin.com/G6wUUXLA
Pretty much the same thing.
(Jul 4, 2020 06:19 PM)Lor‌d Wrote:  I am, I'm using the FaderTheme compiled as a dll.
Quick google search brings this back for a vb.net version of it. I've had it compiled and saved for ages so I'm not 100% sure if this is the same exact code I'm using or not tho.
https://pastebin.com/TTZPRGyD

Edit: Turns out I do still have the original code. I uploaded it here. https://pastebin.com/G6wUUXLA
Pretty much the same thing.

It's my theme... written some 6 years ago.... will recode again with latest framework...

Give me couple of days...

Regards
Saket
BTC - bc1q3efew3yzfwhdz290dafykaw0a2w56g2j69g2c6
ETH - 0xf1c873217032468990D3313da6509D1b813c4671
USDT - 0xf1c873217032468990D3313da6509D1b813c4671
PP - [email protected]
Well ding ding ding. Looks like we solved it! @SaketSaket, if you open source it, I'll help you fix whatever is causing OPs issue so he can move along quickly.
(Jul 5, 2020 09:14 AM)SaketSaket Wrote:  It's my theme... written some 6 years ago.... will recode again with latest framework...

Give me couple of days...

Regards
Saket

You're amazing, I love this theme and have been using it for a while. Hope you don't mind that.
Since you're looking at redoing it would it be possible to add the ability to resize the form as well?
(Jul 5, 2020 10:49 AM)Lor‌d Wrote:  You're amazing, I love this theme and have been using it for a while. Hope you don't mind that.
Since you're looking at redoing it would it be possible to add the ability to resize the form as well?

Your problem is not from the theme.
The theme is working perfectly.
[Image: logo.gif]
(Jul 5, 2020 09:33 AM)Roses Wrote:  Well ding ding ding. Looks like we solved it! @SaketSaket, if you open source it, I'll help you fix whatever is causing OPs issue so he can move along quickly.

It's already open source... posted as public on pastebin...

(Jul 5, 2020 10:49 AM)Lor‌d Wrote:  You're amazing, I love this theme and have been using it for a while. Hope you don't mind that.
Since you're looking at redoing it would it be possible to add the ability to resize the form as well?

Yes i can do that...

Regards
Saket
BTC - bc1q3efew3yzfwhdz290dafykaw0a2w56g2j69g2c6
ETH - 0xf1c873217032468990D3313da6509D1b813c4671
USDT - 0xf1c873217032468990D3313da6509D1b813c4671
PP - [email protected]
(Jul 5, 2020 12:45 PM)n0$f3ratu$ Wrote:  Your problem is not from the theme.
The theme is working perfectly.

And that's what I was thinking too but whenever I minimize the form and re-open it it crashes with the error I originally posted. I don't have any code that runs when the form minimizes or re-opens so I don't know what it could possibly be.
(Jul 5, 2020 02:24 PM)Lor‌d Wrote:  And that's what I was thinking too but whenever I minimize the form and re-open it it crashes with theerror I originally posted. I don't have any code that runs when the form minimizes or re-opens so I don't know what it could possibly be.

I test it under 4.5 framework both as dll as well as code and both times worked perfect.
[Image: logo.gif]
(Jul 5, 2020 02:26 PM)n0$f3ratu$ Wrote:  I test it under 4.5 framework both as dll as well as code and both times worked perfect.

Any ideas what could it be then cause I'm totally lost here.
(Jul 5, 2020 02:29 PM)Lor‌d Wrote:  Any ideas what could it be then cause I'm totally lost here.

Send me your project as it is?!
[Image: logo.gif]
(Jul 5, 2020 05:14 PM)n0$f3ratu$ Wrote:  Send me your project as it is?!

Sending you a private message now
(Jul 5, 2020 05:20 PM)Lor‌d Wrote:  Sending you a private message now

Replace the theme .dll with this one: https://easyupload.io/enpzsf
Good luck.


Also I noticed that for you or your users to run this program you need to install wpcap.
You should add wpcap.dll as reference.
[Image: logo.gif]
(Jul 5, 2020 06:45 PM)n0$f3ratu$ Wrote:  Replace the theme .dll with this one: https://easyupload.io/enpzsf
Good luck.


Also I noticed that for you or your users to run this program you need to install wpcap.
You should add wpcap.dll as reference.

Have you changed any code before compiling .dll?
BTC - bc1q3efew3yzfwhdz290dafykaw0a2w56g2j69g2c6
ETH - 0xf1c873217032468990D3313da6509D1b813c4671
USDT - 0xf1c873217032468990D3313da6509D1b813c4671
PP - [email protected]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by SIM-5195853Jun 6, 2022 10:54 AM 4 168 Jun 6, 2022 10:54 AM
Last Post: HFDone
[C] by HiddenEyEJul 24, 2018 03:20 AM 3 231 Jul 24, 2018 03:20 AM
Last Post: HiddenEyE
[C#] by SilentkillarHFJan 24, 2018 12:51 PM 1 129 Jan 24, 2018 12:51 PM
Last Post: Dotexe