- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I appreciate the help I've received in the past through this forum, and I have a new problem that has me vexed ;-)!
First:
OS: Windows 10 x64
AutoCAD: AutoCAD 2016 x64
Development Environment: Visual Studio 2017
AutoCAD managed code reference .dlls for AutoCAD 2016
Target .NET Framework: 4.5
Language: VB.Net
I have a veeeery long term (read: very slow developing) project with multiple custom commands for AutoCAD that I am porting from VBA (where I've had good success over the years).
Late last fall I switched from developing in VS2012 to VS2017, per recommendations I received here, all to good effect. Recently, though (read: in the last two or three weeks), I've been seeing a very strange behavior when I start Debug mode (F5) from VS. AutoCAD starts up fine, NETLOAD loads my just-now-newly built .dll fine, but when I run one of my custom commands I see this:
Meanhwile, back in Visual Studio, the Form Designer looks like this:
I am using all standard Windows.Forms.Controls object types, but TextBoxes and RadioButtons especially appear with solid black backgrounds and exaggerated black borders, and TextBox text is barely discernible unless selected. None of this bodes well for UI usability.
Not long before all this started happening, I spent time experimenting with a custom control derived from Windows.Forms.Label that would paint a colored gradient background inside the Label's borders, and would also paint a contrasting color drop shadow for the Label's .Text property. I accomplished this with a custom OnPaint event handler, all per directions and discussions I read in numerous places on the general subject of deriving custom controls from built-in .NET Windows.Forms controls...and as far as I can tell, none of which should have had an effect of any kind on anything else in the app.
I have since removed both the custom Label control and the references to its .dll from my project, thinking there may have been a connection. Alas, I still have the goofy dialog box display from inside AutoCAD. Weirder still, another of my custom command dialogs shows a similar issue, while a third one displays just fine! None of the form displays in their VS designer windows show any problems.
Skipping for the moment the visible differences in formatting of the dialog window's borders and title bar between the IDE/Designer rendering and that inside AutoCAD, the closet thing I've had so far to what feels intuitively like an approach is something to do with (...I dunno...) a difference between the IDE and running AutoCAD in where the called code for control objects exists (...should all be the same .NET objects...right?). Maybe there's a setting somewhere in Visual Studio that I changed inadvertently...again, I just do not know.
At this point, I'm not even sure just what questions to ask, so any and all help will be appreciated. And I will do my best to answer questions that anyone believes may help illuminate the problem and/or a solution.
Thanks in advance, and best regards,
--James G.
Solved! Go to Solution.