How can I create a custom menu/navigation screen in Visual Studio 2012 LightSwitch? - visual-studio

Visual Studio 2012 LightSwitch gives you a default of 5 or 6 screens such as: search, create new, etc..
I would like to create a very basic custom navigation/main menu screen. All this screen would contain is literally 6 vertical buttons in a maximized window (For starters and for simplicity of the question) and each button would pop up another screen.
Is there anything resembling the drag-and-drop of a regular Visual Studio 2012 application? I would basically like to create a new Screen Template called: "Navigation Menu" or something similar.
Thanks, DM.

You can only create a new Screen Template by creating a LightSwitch Screen Template Extension.
However it's not really a job for the faint hearted. I've created a number of extensions over the past couple of years, & I regard the Screen Template Extension to be the hardest to do. I understand what goes into designing a Screen Template. It can be quite code-intensive, depending on what you want the template to create for you. I have a couple of screen templates that I want to create for my own needs, but I keep putting them off.
I don't want to put you off, just give you a heads up about what you're in for, if you do decide to create your own screen template extension.
One question though. Are you wanting to reuse this screen, either in the same application, or in other applications? If ther answer is "no", then creating a screen template extension would be overkill.
If you're only wanting one of these screens, to do what you described, all you have to do is add a RowsLayout control to a screen, then add one RowsLayout controlfor each navigation "button" that you want on the screen. Use the Add Button context menu option (right-click the RowsLayout control) to add a button. Set the size etc to what you want, & set the RowsLayout controls Horizontal Alignment setting to Center.
The buttons won't be all that "sexy", they'll just be larger versions of the same buttons that you'll see anywhere else in the application (except for size, if you decide to change that). The main advantage is that you can do it, quickly, & out of the box.
Or you could do something like in this article, Course Manager VS 2012 Sample Part 6 – Home Screen, if you want to improve the look of the screen.

Related

Is it possible to display custom icon in Visual Studio status bar

I am aware of displaying custom text in Visual Studio status bar using IVSStatusBar interface. I have even blogged about it.
However, I have requirement to display custom icon on the Visual Studio status bar. Similar to what Resharper does to display solution errors. On clicking the icon, it also pops-up a context menu.
So, How can I display a custom icon in Visual Studio status bar, and if possible display a menu also on clicking it?. An example will help.
The Animation method of IVSStatusBar already display icons, but uses predefined icons defined in Constants. Is it possible to have custom icons and pass to Animation method?
On exploring the SDK, I found that IVSStatusBarUser interface can be used to display custom information when the window implementing that interface is displayed. But I am not sure whether that interface can be used to display custom icon.
There is no published API for that kind of status bar extensibility. In one of my own extensions (PerfWatson Monitor), I locate the status bar element by searching the WPF visual tree, using a recursive search and VisualTreeHelper, descending from Application.Current.MainWindow looking for the resize gripper in the bottom right - a child element with the Name property set to
"ResizeGripControl". When I've found the gripper, I look at its parent (it should be a DockPanel) and insert my control in there. Note that, as your screenshot shows, Resharper is known to employ a similar trick, so you'll have to come up with a strategy that works with and without Resharper installed. Also note that some pieces of the status bar (the text, the line/col information and any animations) run in their own UI thread, so be careful if your control ends up there.
I notice you also ask about extending the existing animations. Yes, you can supply your own animations via a bitmap strip of 16x16 frames. See http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/fef208e7-b79d-4a0c-94fe-e6861196e1f5/#ba47b61c-77a8-46c8-aa10-a04211312e6c for an example. Unfortunately, this won't allow a clickable menu.

How to view elements in design view using a scrollviewer

Visual Studio WP 2010.
I'm using scrollviewer for text and images on a page, but in design view in VS I can only view the first part of the page which makes placing text and images difficult. I can take a guess and then run the app in the emulator, scroll down to see how far off I am, then go back in design view and try to set margins, height, etc appropriately. Is there another easier way to do this?
Just a guess: During creation set the ScrollViewer's VerticalOffset.
I found the answer elsewhere. In the top section of your xaml find d:DesignHeight="696" and change the 696 to something like 2000, etc. This will extent the viewing area. Anytime you reload or run the application it will default back, but it's easy to reset.

Activereports (under VB6) issue

I have to modify an old VB6 program that uses ActiveReports 2.0 at work and I am having some problems (BTW I have never used this program before and only have a basic knowledge of VB6)...
I have to make some text boxes biggers which is pretty easy to do but as soon as I move them a whole section of text (and not simply the content of that text box) disappear.
I have noticed that it was in some sort of section (sorry, I don't know how they call that) which englobed those text boxes so I made it bigger and that made no difference.
What could be causing this?
Thank you!
Nick
It sounds like the TextBox is inside a UserControl. A UserControl is created by a developer, and is basically one control with any number of other controls in it. You can check to see if there are any User Controls in your project in the Project Explorer (Ctrl+R).
One way to know exactly what class the control belongs to is to open your form in design mode (Shift+F7), click on the control, and look at the Properties window (F4). The drop-down list should show the currently selected control's class name in bold, then the name of the object.
What is the control's class? If it is anything other than TextBox, then this would explain the unexpected behavior you experienced.

where is the specific button on design mode?

how can i find the specific button on design mode where i have several buttons ie: hundered of buttons so that they all like spaghetti and one button may be under another button or a groupbox (i might be playing with the visibilities ) and i want to see my button number 83 on the design. how can i see him? where is he hiding? :) i use visual studio as an IDE. thanks.
MessageBox.Show(" where is the specific button? i know that he is somewhere on the form but cant distinguish it on the design since its somewhere under something i cant find it");
Use Document Outline (View - Other Windows - Document Outline)
Just pick the button from the tree and voila.
PS: this works for other types of designers (WPF/Silverlight, ASP.NET)
You can access it via the Properties Window. There is a drop-down that will list all of the items in your form in design mode.
Then use the drop-down. The drop-down will list all of the items on your form so you will scroll through the list to find Button number 83.
Images were pulled from MS Visual Studio: The properties Window which contains an explanation of the window.
Have you tried using the properties window?

Where do I find, and how do I setup VS with a more "attractive" UI controls?

So today I can create a website using VS and drag and drop some ugly outdated buttons and form elements (e.g. that standard grey button, and square non styled text boxes and drop downs). I know you could replace a button with a graphic, but im no graphic designer. I want to be able to download and install some free plugin/extension that will give me a bunch of different "cool" looking options for buttons (and all the other standard form controls). So in short, I dont need new controls per say (though they are welcome and encouraged as well) but rather, I simply want a bunch of different "cool looking" visual options for the existing .net form controls, so I can make a website that doesn't look like its 90's.
I use vs 05 and 08.
for free controls have a look at codeplex:
http://dj.codeplex.com
http://yuidotnet.codeplex.com
for commercial level controls, Telerik, DevExpress, Infragistics...

Resources