DropDownList Close - combobox

I have an application that uses cascading dropdown lists for an easy 90% of the fields. For some reason, and randomly, they'll close before the user can select an item. This has been very frustrating, as you can imagine. I use Windows 7 with Internet Explorer 9 to test changes once I've completed them and this never happens to me. I can use the production environment without a problem. However, once I launch XP IE8, the problem starts happening. My question is, what can cause this?
I'm using Visual Studio 2008, C#.
Thanks.

It could possibly be that your browser is displaying the webpage in compatibility view. To disable compatibility view go to tools->compatibility view make sure compatibility view is unchecked.
You can also disable it in your code by placing the following code in your head tag:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
You can read about compatibility mode at http://windows.microsoft.com/en-US/windows-vista/Make-older-programs-run-in-this-version-of-Windows
However, this is a random guess at what could be wrong. Without the code we can't be exactly sure.

Without any code we cannot help you.
Could it be that the screen needs to be refreshed or repainted upon SelectedIndexChanged for the combo box ?

Related

Why is Visual Studio 2017's new AutoScale support resizing my Forms app at runtime?

We have a Windows Forms application used for testing our products that has had pretty much the same forms and dialogs for nearly 10 years now. AutoScaleMode in the designer is set to Font for both forms, and that hasn't changed since the original design. AutoSize is set to false and just for good measure (I guess) AutoSizeMode is set to GrowOnly. The following source lines are in Program.cs:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Remember, this has been working flawlessly for years...
One of the recent updates to VS2017 included AutoScale support for monitors with different DPI. I have a relatively high DPI monitor, so when I made some changes to a Settings dialog (adding controls, etc) I started getting bright yellow banners cross the top of the designer surface telling me that AutoScaling was set to 125%, and would I like to change that? I tried going back and forth, and when in 100% mode (Autoscaling off) I was warned that XAML forms might not display correctly. Fine, I am working with Forms so I went back to "normal" scaling and the form looked fine.
Until I tried running the program. Now when I start the program the main form looks like this (details deleted to protect the guilty):
...but when I open the settings dialog it looks like this:
Yikes! It looks worse in practice, the relative images here don't do justice to the difference in size and scale.
I have no idea what got changed or how / why this is happening, but there's no way I can put this into production. I've tried changing the AutoScale settings, to no avail. Can somebody point me in the right direction here?
Thanks in advance!
EDIT: It seems the rescaling only happens on my machine when I run the app in Debug. Whatever is messing up the display of the forms on my machine doesn't do that on my associates' machines and isn't replicated to the executable produced by the build server.
On another note, I tried every DPI-related setting I could find, added those that weren't there due to the program's age, all to no avail. Nothing I have tried has had any effect on the program's display weirdness on my machine. Ugh.
I tried all the tricks I could find, short of disabling AutoScale completely, and nothing worked. I finally merged our develop branch in to my feature branch and inspected all 270 edits, choosing the oldest settings I could find for all size parameters, all controls. Ugh.
Along the way I stumbled across the following line in the Designer.cs file for the form:
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
This setting is NOT accessible from Visual Studio's designer, as far as I can tell, nor can I find anything about how or why it gets set. What I did find was that in the earlier version that did work as expected, the values were (8F, 17F) -- so I manually edited the line to match the older, working version. Success!
I also checked my Windows display settings, and the Custom Scaling value was at 100%, so I used the registry hack mentioned in one of the articles I found following the first link from the comment above (thanks, #Jimi) to disable auto-scaling in Visual Studio, then turned off the notification. Now I'm (finally) back in business.
Registry hack is here:
https://learn.microsoft.com/en-us/dotnet/framework/winforms/disable-dpi-awareness-visual-studio
If one uses the registry hack mentioned in the answer from DaveN59, and there is already entry for your ...\devenv.exe (mine was previously set to run as admin) then add the DPIUNAWARE string to the end of the "Data". Make sure to use a space as a separator.
Example: ^ RUNASADMIN DPIUNAWARE
I'm not sure what the ^ is for, but it was there and I just added DPIUNAWARE string. Also, if you just add this string, it will come up unscaled, but you will still see the yellow banner. To turn that off you'll need to select that option from with in Visual Studio. The instructions are in the link for the registry hack, also provided above. For conveinece here's the menu navigation path.
To disable notifications, choose Tools > Options to open the Options
dialog. Then, choose Windows Forms Designer > General, and set DPI
Scaling Notifications to False.

Windows form has disappeared in Visual Studio form designer

Yesterday I edited a form in Visual Studio's form designer. When I returned to it today, the designer shows nothing. I can open the properties window, select all the different constituent components and edit their properties, but they do not show up. The application builds fine and the form can be run as usual.
I've tried a couple of different solutions, such as checking the .csproj file has the form.Designer.cs included, but nothing has worked.
Strangely, I did see this problem earlier in the week, but it fixed itself when I unlocked my computer after returning from a coffee break.
Any suggestions?
I face a similar problem in Visual Studio 2019.
To help others who may have this issue.
The problem is due to the class declaration in the Form1.cs file.
Please ensure public partial class Form1: Form class is the first-class declared in the file. No other class declaration should be on top of this.
As described in this answer: https://stackoverflow.com/a/40243490/8887398
Thanks,
Sankar
I had similar issues in VS2019. I resolved it by using:
Window > Reset Window Layout.
Then double clicked on the Form in the Solution Explorer.
Prior to this, double clicking the form was having no effect.
Weird, after trying for an hour I ended up solving the issue 30 seconds after posting this!
I edited the size property of an item on the form using the properties tab, saved the form, and then reverted the form.cs, form.designer.cs, and form.resx files to the latest source control version.
At this point the form jollily re-appeared.
Edit: FWIW, this didn't work with another form which was exhibiting the same problem.
Edit 2: That other form has now fixed itself after coming back from lunch and unlocking my PC... Might be something to do with how that affects the display - everything shifts over to my right hand monitor when I do that.
Edit 3: OK, now it seems that modifying my display DPI fixes it. On Windows 10 go to System Settings -> Display, and then move the "Change the size of text: 100%" option to say 200%. Once this changes on screen, move it back to 100%.
This seems quite foolproof, although you sometimes have to jimmy it around a lot before it finally works. I know it has worked when I get both a vertical and horizontal scrollbar; the form is then further down the page.
Just go to Form1.cs (Form1 is the name of your form), if you are able to see your source code then press Shift + F7. The form will show up.
I also had a similar issue in VS2019.
My form [Design] was listed in the solution explorer but the code was not listed as a sub-item of that form.
I could access the code by right-clicking on the form in the solution explorer and choosing view code.
What seemed to solve the problem was to close down VS2019 and simply re-open it up.
A Message appeared (with Errors and Warnings) for me which said that the first mentioned class in a cs code file must be the form class. I shifted my form class to the top of the files and everything was fine.
There are actually a few reasons that one might encounter this issue.
At times, it can be due a problem within the VS IDE and the way it incorrectly manages file types and subtypes. It normally does a great job with this "automagically", but it can also make painful and unexpected mistakes.
If you right-mouse-click (RMC) your Project, and unload it (not your solution) you will be able to RMC it again and choose "Edit Project File". Once there, search for your Form name. In my case, I will search for Form1.cs, note the incorrect icon I saw in the Solution Explorer View, and the code describing my form, within the project file:
<...>
<Compile Include="Form1.cs"/>
<...>
Change this declarative statement to the following, adding the "Form" subtype:
<...>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<...>
Save your project file, then RMC on your project name in the Solution Explorer, choose "Reload Project", and you will see the correct icon as expected, and once again be able to use the form in Design mode:
*Note: This issue shouldn't occur with default forms (named Form1, Form2, etc) and even in my case, it happened with a form I named other than the default form name. I used that name in this example, purely for illustrative purposes.
Hopefully, this helps someone.
Wishing you all the best!
I hadn't changed anything that would have broken my form, yet it still wouldn't load when I tried view designer. Restarted VS2019 and it worked after that. Give that a go before you try anything else!
I had the same problem.
My solution was to remove and add again the System.Windows.Forms reference.
Go to Tools > Options > Environment > Preview Features and select the Use the preview Windows Forms designer ...
Then restart

WPF: Menu items and combo boxes don't render in Windows 7 64-bit

I'm trying to use an existing internal WPF application (I do have access to the source), but it was developed on XP and I'm using Windows7 64-bit.
When I click (for instance) the File menu, 90% of the time I see no drop-down menu at all. The menu still exists - I can use the arrow keys to navigate up and down and choose an option if I happen to know the order of the options, but nothing renders at all.
The other 10% of the time, the menu or some portion of it DOES render, but as I move the cursor up and down I get graphical corruption or disappearing options until I end up back at the "no menu is visible at all" state.
This is also true of combo boxes within the application - they show no data when I drop them down, but I can arrow down and choose an entry.
Microsoft has some advice about WPF rendering issues here but none of these steps has helped with my issue.
Edit: a coworker running Windows 7 sees the menus just fine... he has a different video card, so I'm curious whether this is video-card specific.
This also sounds similar to an issue we had seen in XP, where comboboxes (or menus) would not display properly some of the time. There is a Microsoft hotfix (for at least one flavor of it) here, but unfortunately it is for XP and WS2003. I'm not sure if this could point you in the right direction.
The link to this hotfix was found in this MSDN thread. I am not the author of this particular link, although I do remember raising this issue some time (and a different job) ago.
It turns out that in this specific case, the issue is only present on boxes that have a GeForce 6800 video card. Updating drivers has no effect, but switching to a 7800 makes the issue go away.
I have no idea why this is the case, and I haven't found any information online about 6800-specific graphical issues in Win7 64, but our testing and experimentation shows this is the factor that causes it.
Crazy.
See this question. It's probably a problem with a DropShadowEffect, removing the Effect should fix the problem.
I second that the issue is related to NVidia Windows 7 x64 drivers. Recently I had to replace my video card. Now I have Quadro FX 3400 with the latest drivers and am seeing similar behavior. WPF ComboBoxes don't render dropdown portions. I can only switch values with keyboard after a few attempts. It could be Direct2D-related issue. I also had to turn that off for Firefox to start working again.

How to display the report icon in Firefox for the SQL Server Reporting Services Report Viewer control

It seems that due to ActiveX that Firefox can't display the print icon/button on the Report Viewer control in SQL Server Reporting services. Has anybody figured out a way to work around this or gotten this to work?
If it's not possible, does anybody know of a way to add a standard button that would trigger the print behavior on the report viewer control?
As you state, the print functionality is ActiveX, so it will not work in Firefox.
You could place a button in the "msrs-buttonHeaderBackground" div using a javascript button.
I found the div using the firebug firefox extension - it's great.
You could possibly find the other divs you'd like to hide and put them in a print style sheet, so they don't show up when going to print.
http://www.456bereastreet.com/archive/200709/how_to_create_an_unobtrusive_print_this_page_link_with_javascript/
I agree with the author that ctrl-p could simply be pressed for a similar result instead of adding a button - but the print style would still help in that.
You know what...I just realized something. You will not be able to print a page that is more than one page! Ouch.
I know this is a very old questions, but we came across this and chose the following solution.
We downloaded an IE Tab extension(this is one there are several more) for FireFox and then configured that extension to use IE to render the report server URL by default.
You could easily create a how-to web page,pdf, or maybe even create a dummy report that shows the instructions on how to do this to your end users and then you're all set.
So now every time the report server website is accessed it's being rendered in IE so the print button shows up. Every windows machine already has IE so no compatibility issue there, unless you're not using windows. :)
My best suggestion would be from within Firefox export it to PDF and then print it from your PDF viewer. In my experience this is a better way to print the reports anyway.
Hope that helps!

Visual Studio GUI is see-through?

I'm having some trouble with Visual Studio 2008 on my Windows XP SP2 laptop.
What happens is that when I start a program with a few textboxes and stuff like that, the boxes are see-through. I can litteraly see through them and see what's on the underlaying screen. Like if I only have this Form showing and behind that my wallpaper, I can see my wallpaper through the Textbox, ComboBox, even through the small cracks between various elements.
i've searched the web but haven't encountered info on this yet. Does anybody know what might be causing this and how to solve it? I'm in the process of trying to see how the text in my TextBoxes is parsed, but I can't since I can't even enter anything. I click on the textbox and I'm focused on the desktop...
Hmmm... I'm not sure about this, but check the "Transparency" property of your main form. That's all I can think that it might be as of now...
Update: I meant the "Opacity" property, sorry.
Update 2: No, never mind, sorry. Right-click the "TransparencyKey" property, and press Reset to set it back to default.
Check TransparencyKey, Opacity and maybe TransparencyMask?

Resources