what are controls .NET equivalent to this image? - c#

in this picture,I can see: MenuStrip,??,TextBox
how do I an bar like this that have the enumeration?
I hope this clear. Thanks in advance.

If you're talking about the menu bar at the top of the window (just below the caption/title bar, which you should get for free from any Form object), then that is not a MenuStrip control.
The MenuStrip control doesn't use the native Windows menu bar, which means it's going to look very different on Windows Vista and later where the appearance of the standard menu bar was altered to be blue and plasticky. Since MenuStrip is drawn entirely in C# code, it's going to look permanently cheesy and stick out like a sore thumb.
If you want the standard Windows menu bar, you need to use the old MainMenu control. This is what everyone used back in the early days of .NET, but it's still available for backwards-compatibility and for people who care about what their apps look like. You'll probably have to add it to the toolbox manually because it's not there by default. Right-click on your toolbox and click "Choose Items", then find MainMenu in the list of available controls and ensure that it is checked.
As Blorgbeard suggested in the comments, if you're talking about the line numbers and the text editing control, they're not the standard TextBox control, either. In fact, they're not a standard Windows control at all. That's a custom control designed specifically for editing code, probably Scintilla.
You can find a .NET implementation here: http://scintillanet.codeplex.com/

Related

Why when adding to tool box in windows forms project a dll file there is no this little gear icon near it?

In this screenshot on the left you see ExtdTextBox and ExtdTextBox1 and on both near it there is no this gear icon in purple. Where is it ?
By purple gear i mean this for example:
Your screenshot shows the standards ToolBox icon for UserControls.
This is probably what ExtdTextBox and ExtdTextBox1 are.
If you really wanted you could try to change the icon to show somthing else, at least if you have access to the sources and can add an ToolboxBitmapAttribute to it. See here and here for details.
However, even if you do that I don't think chosing a gear icon would be a good idea since these are usually picked for items that control settings. The example you show, from a more colorful incarnation of VS shows AJAX controls, which may explain the gear since they will talk to a server..
Also note, that the doc says that for the custom icon to show it is necessary to explicitly add the controls to the ToolBox via Add to toolBox..
I don't think it'll be worth the hassle.

How to Show the Form's Own Icon on a Floating Window using DockPanel and its Extender?

With the Weifen Luo DockPanel component, one can add to their .net project the ability to dock forms within other forms. The component is very well done.
Now, I see from this page at the project forum at github (where this component is now hosted), that it is possible, through the use of this dock.extender to allow the floating windows to have a normal winform look, that is, sizeable with regular Windows title bar, maximize box, minimize box, etc (see here, too). This also allows for the form's icon to show.
My problem is, and hence my question, is that the icon I assign in the form's properties will show in the designer, but one it runs in debug as a float-panel, a generic form icons appears in its place.
Now, I tried assigning the icon through code (both in the form's own code, and in the main application code too, where the form is called) rather than through properties, and that didn't work either.
So how do I get my own custom icon to show as the form's icon when the form is floated, and the extender is used? I am using the main docking panel in DockingWindow mode.
[EDIT]
I think this is a hard question! It's been 2 days and I've not gotten any answers!
This requires a change to the the FloatWindow class itself to set and update the Icon property internally as the content changes.
I have just checked the change in and it will be included in the 2.7 release of the library.
https://github.com/dockpanelsuite/dockpanelsuite/issues/35

Default windows forms resizing behavior

If I have created a forms app and not specified anything out of the ordinary (just used Visual Studio's designer to drag and drop controls), what behavior should I expect when resizing the window? Does it differ based on what controls I used? Is there detailed documentation of this someplace I can reference?
(I hate asking something so vague and contrived, but I don't have access to Visual Studio and the developers who do aren't being helpful. As far as I know they're using C# and not using any sort of layout panel.)
It sounds to me like you need to know about anchoring and docking the various components, how they hold together, and how they behave when resizing the form. Please see this link for a guide on how to do this effectively, and how some of the various options work.
Controls on a WinForm application do not resize by default. Look at using the Anchor property on controls. For example. If you want a button to widen when you widen a form go to the Anchor property on the button and anchor the left and right sides. This will widen the button as the form widens.
You can think of the anchor as the parts that get "pulled" when a form moves.
See this post:
Auto size the controls in winform

How to change controls on a Windows form without changing the form itself

What I am trying to remember is the name of a windows form control which allows with an ID change allows programmer to move between its states, which are different panels with different controls on them. There is a control that does exactly this - but I can't remember its name at all. Do you know anything similar to this in C#?
edit: basically, I have a windows form. It has a panel. I want to, by changing panel's a specific property, I want to switch between its states, every state containing another set of windows form controls. I cannot, however, remember the name of this control. Any ideas? Sorry if my first wording is confusing.
It sounds like you mean something like a wizard? In asp.net webforms has a wizard control buy afaik the closest in windows forms is TabControl. But no matter; it is trivial to simply hide and show some Panel controls. It can be trickier to use the designer, of course - but you can lay them out next to each other and move then at runtime as needed.
Looks like there are a few wizards available for WinForms too
https://stackoverflow.com/questions/195255/best-wizard-control-for-net-windows-forms
http://www.codeproject.com/KB/cs/WizardDemo.aspx
And, well, plenty of others

Creating a custom menu in .NET WinForms

Using .NET 2.0 with WinForms, I'd like to create a custom, multi-columned menu (similiar to the word 2007 look&feel, but without the ribbon).
My approach was creating a control, and using a left/right docked toolstrip, I have constructed a similar look&feel of a menu. However, there are a few shortcomings of this solution, such as
the control can only be placed, and displayed within the form;
if the form is too small, some area of the control won't be displayed;
the control also have to be manually shown/hidden.
Thus, I'm looking for a way to display this control outside of the boundaries of the application. Creating a new form would result in title-bar deactivating on display, so that's also out. Alternatively, any other approach to create a customized menu would be very welcomed.
Edit: I don't want to use any commercial products for this; and since it's about a simple menu customization, it's not related to Microsoft's ribbon "research" in any way.
unless you are in the business of providing .net components, you should be looking to buy it off the shelf. Its a lot of work getting such a control right - There are already vendors providing this kind of UI. e.g. ComponentOne
if you are trying to build this component as a product, you should look at the link below. Apparently Microsoft has a 'royalty-free' license around the Office UI to protect their R&D investments. As of now you need to tell them that you are using something similar to the Office UI. More of that here
The MenuStrip class has a Renderer property. You can assign your own ToolStripRenderer derived class to customize the painting. It's a fair amount of work.

Categories

Resources