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?
Related
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.
I've bundle of control save in .vcx file but I need to activate it to display it when i switch to different activepage in pageframe.
Could anyone guide me how to code and which kinds of event should i make on page frame switch, click or whatelse UIENABLEEVENT.
Thanks.
First, you might want to click on Help -> Tour for site etiquette and start voting / checking your answers so people know what worked or not that help you and others with similar issues.
Now, back to you question... If you have a form with a pageframe, make sure you have the "Properties" sheet open, it helps to ensure which object you are actually working with until you get more familiar with the IDE.
Once you click on the pageframe control, if you right-click and then select "Edit", that will bring you to the individual PAGE level of the pageframe. Once the PAGE is the basis of the focus you can put any control on it from either the toolbar, or if your project is open and you expand your .VCX class library, you can grab any control and put in on the page.
If you have multiple pages, once you click on the alternate pages, you will see that the first page (or whatever page) is no longer visible and the new page is available for you.
The actual handling of the pages on the pageframe for clicking / focus is automatically handled for you unless you want to do something extra.
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.
I am wondering how to display a XAML page within a tab control that is part of another XAML page. Or, for that matter, if this is even possible. I want to be able to click a button on page1 and be able to view the page2 from within a tab control that is on page1.
Would this be something to be handled within a Frame control? Or something different? Or is there a better approach to this altogether?
I am programming in Silverlight-4.0, C#-4.0 from within Visual Studio 2010.
You could use the navigation framework, but that isn't really what you're asking. You want to know how to put the contents of one file into a tab, while the contents of another file are in the other tab.
A page in silverlight is simply a user control. You can put a usercontrol into the tab just like you would any other control. In order to use a local usercontrol in another xaml file, you'll need to do the following:
Add this to the root element of the page containing the tabs:
xmlns:local="clr-reference.MyApplicationNamespace"
Then you can add this to add the control into the tab:
<local:usercontrolname name="mycontrol" someproperty="value" />
You can check the Silverlight Navgition Framework You can show "frames" inside your control. It also support deep linking, which is the killer feature here..
This is a very good intro - by Tim Heuer
I inherited the prototypical corporate application with a person form (with address, phone, etc).
Now on that mentioned person form one label+textfield is a child of the form itself and not of the panel it visually belongs to.
How can I change a control's parent from form to an existing panel in VS 2008 designer?
Update:
Ah, it seems to be a problem with the super magic custom group box control my beloved cow orker left for my pleasure. Dragging into a normal group box works ...
Update 2:
With the help of the Document Outline I can see that the custom "GroupBoxExt" we have in the application is defective, dragging a control onto the panel (or just changing position of a control on the panel) assigns it to the form.
Update 3:
Now that I new what was wrong (thanks for the document outline tip) I went of to google and found a custom group box on CodeGuru. The author of that artilce found out you'd need to decorate your custom panel with
[Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))]
to make it behave as a nice container.
If you're looking to do this in the designer, what you're looking for is the Document Outline panel (it's under the View menu under "Other Windows"). From there you can drag controls by their name in the outline and reassign the parent.
Hope this helps!
I'm not sure exactly what your asking. Can you try clarifying the scenario a bit?
But if you want to change a controls parent, all you need to do is make that control a child of the panel using the Controls property.
myPanel.Controls.Add(target)
This should update the parent of target to be myPanel.
If you're attempting to do this via the designer, all you need to do is drag the target control onto the panel and that should take care of it.