Visual Studio 'Data UI Cutomization' - c#

In 'Data Source' window from where I can drag and drop data sources to a form, I can set the field to different control 'Textbox', 'Label', etc. But I used to be able to set them to some third party component (in this case Telerik's components). Just now I started to work on my project again, and these third party components do not appear there anymore.
I click on the choice list, customize ... I get the window 'Options' width 'Data UI customization' selected, there I used to be able to select Telerik's control, but again they don't appear there anymore.
How could I customize this ?

I ran into something similar back in December... apparently with some windows updated / service patches, it corrupted something. I couldn't even pick a UI control of my OWN. I even tried by creating a BRAND NEW project, created a single class and it would not appear in the toolbox to be put into a form anywhere.
By doing some digging, I came across a blog (don't remember where), but it directed me to do the following. Get to your Visual Studio Command Prompt. There should be one in your Startbar menus specifically under your Visual Studio icon group.
Once at the command prompt, do
DEVENV /setup
This apparently does some fresh "cleanup" settings and fixed whatever was stopping the classes from being displayed. As soon as I did, and re-started VS, the class libraries appears and able to be put into forms no problem.

Related

Windows 10 File Browser popup menu showing New items

Using:
Visual Studio 2017
Windows Form
C#
I know how to create a Popup menu displaying items that I have added with code to a native WinForm ContextMenuStrip control.
For example:
My coded Popup menu
What I am looking for and trying to achieve and I have not found so far is how to populate a ContextMenuStrip or any alternative control with the Items that show up when you right click on a blank space on File Explorer and select New and displays a list of the Items you can create base on what you have installed on your computer.
For example:
File Explorer Popup Menu > New
I have looked at many suggestion on different sites but they all show what I already know in how to add items manually and none explain how to add the Items that show up in the File Explorer New sub menu.
Could anyone tell me if this is even possible and/or point me to the right place.
Regards,
You're describing the problem as if it were some programming task, so most probably, it's not the thing you expect to see. Adding items to that menu is more of a problem of configuration of the almighty 'explorer.exe'..
Please see here and read where to place item templates and how to register "file classes" for them in the registry.
I don't like answers like this that just drop a link to other resource, but it's not reasonable to copy&paste&redact it all not knowing if it's what you really want..
Also, note that if you see your desktop, then 'explorer.exe' is already running, and editing its configuration in the registry probably won't take any effect until this process is restarted. Typically you get advices like in that article above:
To have this change take effect, you need to restart your PC, not just sign out and back in.
But that's not true. Just kill explorer.exe via task manager, and then start it back again. No need to reboot.

Can't Move Controls With Mouse on Windows Form Designer

I recently installed Visual Studio 2013 Professional, and found that in the Windows Forms Application project type I'm unable to move any controls on a form in design mode. I tested a few alternatives out and found the following:
Controls can be moved with the keyboard
Controls can be resized by dragging the keypoints on the outline of the control
Controls can be aligned using the commands in the Tools menu
Controls can be moved by setting the Location field manually in the designer property grid
Controls can be docked
Controls cannot be moved with the mouse
Furthermore, as you can see in the image below, the "cross" icon that indicates that the controls are movable is not visible on any controls.
I've tried the following, but have not yet been able to correct the issue:
Created a new project & solution (same issue)
Created a new form (same issue)
Verified that the Locked property of both the form and controls is set to False
Verified that the form inherits from Form (as expected, as this is a standard installation and the first time I've used it)
Googled for help (nothing that worked)
Any suggestions would be appreciated.
It took some time but I finally found a workaround, if not an answer. As it happens, periodically my computer will stop allowing me to drag-and-drop anything. The solution to this is to press the Esc (escape) key, which instantly restores functionality.
I had this happening using multiple monitors.
Move VS to the main monitor (1) and all will work fine.
Greetz
I know this is an older thread, but this problem still persists. I am putting this here because I think some of these may work for others. The top option works for me, but is by no means a permanent solution. It helps to get your project completed though. Design your forms on your main screen then move VS to your secondary monitor to code kinda thing. I work off a laptop, so I don't like working on a small screen.
Some steps are rudimentary, but I was trying to be thorough. Sometimes it's the simple solution.
Preliminary troubleshooting...
Moving VS to main monitor(1) - this worked for me, but still doesn't allow me to use my 2 monitors
Run installer, select Repair
Run and cancel your project
Press the Esc button and see if things return to normal
Right click form "Lock Controls". This should not have the blue outline, or right click on form/control>Lock Controls and make sure nothing is locked.
Rebuild project, close and open the form again.
Snap to grid setting - Tools>Options>Windows Form Designer>General
Restart VS with 100% scaling - drawing may be an issue. I am not convinced it is not here since it works on the main screen but not the 2nd or 3rd
Dock property set to none for form/controls
Moving items very slowly with mouse - another indication drawing may be an issue.
Controls may not be docked in the container in which they reside. Restart VS. Try double clicking on the control, then move. I think this is indicative of creating the control outside a container(say, on a form), dragging it into another container(say, a tabControl) and then it not moving within that tabControl. Additionally, try creating new controls within their intended container and then trying to move them.
Close VS, delete C:\Users\user.name\AppData\Local\Microsoft\VisualStudio\15.0_xxxxxxxxx folder
Mouse driver - some software may cause issues here.
Absolute positioning - Tools>Options>Web Form Designer>CSS Styling>Change position...
Right click any item under toolbox and select "reset toolbox"
Requires Reboot...
Close VS. Delete some config files with current dates (devenv.exe.config, toolbox.tbd, toolbox_reset.tbd, toolboxindex.tbd, toolboxindex_reset.tbd) and reboot the PC. These are found in a directory like C:\Users\tdevy97\AppData\Local\Microsoft\VisualStudio\15.0_18c2eb4a where the last folder(15.0_18c2eb4a) is some random name. Reboot. Restart VS.
Corrupt toolbox? Close Visual Studio, Open the “c:\Users\AppData\Local\Microsoft\VisualStudio\14.0” folder and remove all the .TBD files, Start regedit, Find the “HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\ToolboxControlsInstaller_AssemblyFoldersExCache” and “HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\ToolboxControlsInstallerCache” keys, Remove everything from these keys leaving them empty, before you removing it, (back up your registry first), Reboot, Run Visual Studio again and wait until it recreates all items in the toolbox.
Last resorts...
Open command prompt as admin, navigate to your "IDE" directory (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE) and run the following commands...
devenv.exe /resetskippkgs, it will clear all SkipLoading tags that have been added to VSPackages by users who want to avoid loading problem VSPackages.
devenv.exe /resetsettings, it will restore Visual Studio default settings. Optionally resets the settings to the specified .vssettings file.
devenv.exe /resetuserdata, it will take a couple of minutes to run as Visual Studio cleans up and sets itself back to its original state. You may open Task Manager at this point to check whether the devenv.exe process is still running. After it has completed running, you can restart Visual Studio.
devenv.exe /uninstall /force - complete uninstall. Reboot. Reinstall. Rock on!
In my case, I had to change the Dock property to None.
I had this issue and tried solving it using some of the aforementioned methods, including pressing Esc, rebooting, and deleting the folder in AppData, but none of these worked for me.
"Solution"
I have a dual screen setup, and what I eventually did notice is that if Visual Studio starts up on Screen 1 and is then moved to Screen 2, the components will snap back to their initial location after being clicked and dragged. After moving the Visual Studio window back to Screen 1, the components click and drag as usual. I am unsure of the cause of this since it never used to be a problem, but for anyone using dual/multiple screens, this may "solve" the issue.
I just found myself in similar, but slightly different situation - I could drag all controls without the "cross" icon such as buttons, but could not drag any control that had the "cross" icon such as group boxes and panels. One workaround that worked was to use the "arrow" keys to move the controls, but only a computer reboot fixed the issue. The solution, posted by Brett Wolfington did not work in my case.
Found a solution!!
I had the same problem:
Holding the mouse button and trying to move the element with no effects!
My solution:
Try after pressing the mouse button to move the element very slowely - it works!
I think it has maybe something to do with the mouse speed/acceleration settings. I changed them to the maximum. I guess VS has a problem with that. When i move the mouse slowely at the beginning then it works just fine!
Answer to a slightly different question, but my googling lead me here, so perhaps it helps someone else.
If no movement works, also not with keyboard, check the "locked" property. That was it for me in a colleagues project, so I was not aware he had locked it.
The controls also have a tiny lock icon so if you look closely you will notice.
None of these solutions worked for me. These are the steps that worked for me:
Close Visual Studio
Delete the Visual Studio AppData folder, usually at C:\Users\user.name\AppData\Local\Microsoft\VisualStudio. My folder was named 15.0_b148b13d, but your folder may have a similar name.
After deleting, Visual Studio took some time to initialize but I could finally drag the controls.
Seems its a drawing error. The controls actually moves, but there is a short time delay before you see it!

Where is the shortcut "Open in Blend" in Visual Studio 2013?

Sometimes I see the shortcut sometimes I don't. I'm not sure why.
How can I make the shortcut permanent?
I believe I have an answer. It worked for me flawlessly. After being frustrated, I wrote to MS through the Feedback option in VS2013 (at the top). A week later, one of their employees responded with this:
Hi,
Thanks for raising this issue to us through the Visual Studio
Feedback program. I am interested in helping investigate the issue
you’ve described. After creating a new WPF app in Visual Studio 2013
RTM, I was able to reproduce the issue you’ve described. By default,
.xaml files do not have the “Open in Blend…” command enabled in the
context menu in the Solution Explorer. However, I was able to
successfully add this command in both VB and C# WPF projects in VS
2013. It sounds like you might have also tried this method, but please try the steps below and see if you are able to successfully add the
command. I hope that step #6 might be the trick in successfully
enabling the command for you. In order to add this command, I
followed these steps:
Tools > Customize
Select Context Menu radio button
From the Dropdown, choose “Project and Solution Context Menus | Item”
Click the “Add Command…” button
Select View category
Select the third (bottom-most) “Open in Blend…” command (there should be three available)
Close dialogs
Right click MainWindow.xaml
Select “Open in Blend…” (it should not be grayed out)
Of the three “Open in Blend…” commands available, the third one is the
only one which successfully worked on .xaml files in WPF projects. The
other two would be grayed out when I tried to use them. Please
contact me to let me know if you are able to successfully add the
command or if you still see the issue. I look forward to your
response, and I hope that this will successfully resolve your issue!
Thank you,
Scott Rick
I am impressed by the fact that he gave much consideration to this issue and actually tested several methods. In my case, there were two "Open in Blend..." items, so I chose the second one and it worked flawlessly.
Hope it works for you as well.
You can customize it:
Keyboard Shortcut: how to
Integration in context menu:
Tools->Customize
Click on Commands tab
Click on Context menu and choose "Project and Solution Context Menus | Item
Click on Add Command
Select View as Category
Select 'Open in Blend' command
You get this context menu option now for every item but that should not hurt...
When working on a Silverlight, Windows Phone or Windows Store app project, you can use the View -> Open in Blend command to open your current active tab/code XAML window in Blend.
The above menu choice is not available for WPF apps only. No idea why.

Can't select controls on my form

This has started happening recently (not too sure what caused the change unfortunately), but I can no longer select controls on my form. My reading on this has uncovered some possible explanations including:
You're running your program in debug mode
Your form is derived from another class where everything is private
Your controls are "locked".
For (1), no, it's definitely not running and for (2) my form is derived from DevComponents.DotNetBar.RibbonForm. For (3), no, they're not "locked" (I tried locking and then unlocking, in case some state was stuck in the designer, but no dice). The controls are on my form, not the base class form and the instances aren't private (I deliberately made them public just to test this one) and they were working fine before.
So, what can I do? I can select a control, like a ComboBox, from the Properties window drop-down list, change its properties and so on. But when I choose it nothing gets selected in the designer. I can select the form itself (by its border) and resize it in the designer. I can add a new control, like a label, and interact with it fine in the designer, so this is something that's happened to my existing controls.
I'm sure it's either something spectacularly dumb, or Visual Studio 2012 is on the wind-up.
Anybody?
Edit: Zipped the solution up and brought it home. Cleaned and rebuilt and it's working fine in the designer. I guess there's an issue with my install at work, somehow.
The problem can occur when a new version of DevComponents.DotNetBar is installed and the old version is still referenced from a separate library folder.
The app and all DotNetBar referenced dlls should be re-referenced to the latest version.
Well, I kind-of solved the problem, although I don't know what the actual cause was. In my program I'm referencing devcomponents.dotnetbar dll. I removed the reference and then re-added it, rebuilt the program and now everything's working in the designer as it should.
This problem's main reason is because of older versions of components being used in a project and a newer version of the component has been installed on the machine. 9 times out of 10, the project is still pointed to the component in the GAC. Remove the reference to the component and re-add it from the newly installed component's location and all should work fine.
I had the same issue with DotnetBar, resolved it by adding the reference DevComponents.DotNetBar.Design.DLL in the project
Just right-click the form and uncheck Lock Controls.
Resetting the Toolbox (Right click inside Toolbox) and then "reinstalling" the new toolbars did the trick for me. Seems to be a bug in Visual Studio.
I had the same situation but Closing and Re-Opening my project solved the problem
I had the same issue after moving a project to another PC. I didn't install DotNetBar on the new machine and just copied the DevComponents.DotNetBar.dll. I resolved it by also copying DevComponents.DotNetBar.Design.dll (contained in the old machine's DotNetBar installation directory) to the new machine and referencing it in the project.
The general issue is using references that no longer exist. For me, I had several versions of Infragistics controls and uninstalled all but the latest version. At least one of my references pointed to a DLL that didn't exist. Therefore, the seeming removal and re-adding essentially pointed the references to the correct (or present) DLLs.
Also, one of the symptoms of this problem is that the labels for the controls appears in a window below the dialog/form.
To get this working for me I ended up having to add the references to the designer for the different controls: SuperGrid.Design and DotNetBar.Design
I had that problem, and it was caused after I wrongfully played around with my "using" and "namespaces" in a blind attempt to get rid of an error. I saved each .cs file one by one and then closed VS and re-opened it. Presto, the little locks vanished.
I had the same issue, you can ctrl+a to select all, then move the controls to somewhere, doesn't matter where. Now you will be able to select them again seperately.
I got this problem by dragging a tab down so i could see two codes at the same time.
I know this is an old post, but in case it helps someone else, my version of this problem was an inability to select controls on a tab page. Sending the tab page to the back didn't help. But I found I could get the controls highlighted by selecting them in the properties box and then placing the mouse over the control sizing arrows and right clicking, I could then bring the controls forward.
Just Closing the current Soln and Opening again solves this problem,
This might have caused because of some hidden selections in other forms!
For me the issue was only with "Send to Back" and "Bring to Front"
I did Control+A then deselected every other control, then right clicked on the controls i was not able to see before and just clicked "Bring To Front".
For me the issue happened because i removed those controls from Group Box.
Visual Studio 2019, I close the form, and any files currently open that are associated with that form (.cs .rex) and then reopen them. This solved my 'not being able to select a control' problem. I find this problem occurs occasionally, and is a bit of a nuisance, but this simple fix always seems to work for me.
I ran into another variation on this theme. I'd placed Infragistics controls into a lib folder. The project would still compile/run, but for the controls to be selectable in the editor the project must reference the original installed controls. See Cannot select Infragistics controls in WinForms designer for more details.

Is there a utility that can monitor open windows/ in .net winforms?

This is a general question, but I'll explain my specific need at the moment:
I want to find the framework class that enables one to choose an image at design-time. I can find the editor that is used at run-time - its the Drawing.Design.ImageEditor. At design time, however, a different editor pops up which allows one to choose an image from resources.
I'm guessing I could run some kind of program, then open up the image editor, from the property grid, and see what new windows/classes have been created?
Thanks
Yes, you can see what's being used by using another instance of Visual Studio and use Tools + Attach to Process (managed) to look at the call stack. It is a Microsoft.VisualStudio.Windows.Forms.ResourcePickerDialog. That is not something you can use in your own code, the Visual Studio designer assemblies are not re-distributable. Nor would they be useful, they monkey with the design-time state of the project.
Making you own isn't that hard, just use Reflection to iterate the properties of Properties.Resources and find the ones that have the Bitmap or Icon type. Display them in a ListView to allow the user to pick one. Adding resources at runtime isn't an option.
A tool with similar functionality to what you mention is Spy++ which you can find in your Visual Studio folder on the start menu (under the sub menu Visual Studio Tools).
However, if I understand you correctly, I don't think the design time editor you're talking about is written in managed code and even if it was, I'm fairly sure it's not in the framework. It's just part of Visual Studio itself and as far as I know you can't get hold of the source code for that.

Categories

Resources