Visual Studio 2010 C# Form Project - Drag and Drop - best method? - c#

My aim is to create an application whereby a user can drag a label from a tabbed container into some form of holding area - which had a ruler and a basic grid. I have consulted Google on the subject but the tutorials seem to involve dragging and dropping form components in design view.
The final aim is to then take my holding area and translate that into a .xml file - whereby each dropped element has an entry as follows:
[Dragged Component Name][X Co-ordinate][Y Co-Ordinate][Other Param's].
Any help with both aspects would be very much appreciated - this is just for a demonstration to a colleague.

I think you need something like this:
http://msdn.microsoft.com/en-us/magazine/cc163871.aspx
This link contains information on creating form designing forms looking exactly like Visual Studio Forms Designer. This way you may need to handle less situations than writing a forms designer with conventional methods.

Related

Qt creator - how can I enable snaplines?

when I developed apps in C#, in visual studio designer there are lines which help with positioning form elements, e.g. it helps me, when I want to place one button right under another, on same X pos, when they have same X or Y snapline appear. can I enable this or similar feature in QtCreator? It's hard to make nice gui without it.
here is picture of snaplines in visual studio C# designer:
To make nice GUI in Qt Creator you need to read about layouts:
http://doc.qt.io/qt-5/examples-layouts.html
There are examples of basic layouts in documentations:
http://doc.qt.io/qt-5/qtwidgets-layouts-basiclayouts-example.html
What you show on your image, it is called Vertical Layout. Layouts can be within each other and you can create very complex interface through them. It will be resized correctly together with window.

How to make custom form control in c#

I was trying to do something in visual studio the other day when I realized, if I could just make a form control to do it for me it would be allot easier, except I have no idea how to do that, I want the form control to have grids, each square having its own color property, if anyone knows how to make form controls, or even better knows how to make something like what I just described, I would be very happy :D
This MSDN article is a basic step by step outline of how you can write a customer control.
Unfortunatly MS has not figured out how to do avoid link rot -- so you may need to search creating custom winform controls to find this if you come in the future.
You are usually best servered by subclassing an existing control and customizing it.
You might also find some of the freely available winform control projects a gold-mine of useful info if you get serious about this.
However, it sounds likely what you should consider doing is creating a "User Control", this is usually simpler for a composite of few existing controls. This
article on the types of controls for winforms may be a useful overview for you.
Beyond that you really should use S/O if you are trying to resolve a specific problem you are having when you are coding. Google is a more appropriate tool for finding tutorials, etc.
1) Inside your project: Solution Explorer --> Right Click the .csproj --> Add UserControl
2) Drag and drop gridBox or any control you want into your custom control.
3) Check the ToolBox, your custom control should be located at the very first selection

C# Control Name

I have two questions.
I am usinq Devexpress Winforms
What is the name of control of the
Visual studio toolbox.I wanna add a
control list like visual studi
toolbox.What is the name?
How can I add the flow chart to my
c# project?
For Dev Express, I would perhaps try something like the XtraNavBar:
Windows Side Bar Control
For a flow chart, I don't think Dev Express has a C# winforms flow chart right now.
See comments from Dev Express
#Deneme, The style of control that you see as the Visual Studio Toolbox is called 'an accordion control'. There is not one in the standard forms toolset, but it is not too difficult to build your own out of buttons & panels, and you can tailor it to your own needs and situation.
As for your second question about adding a flow chart, I am not aware of a single tool that you can drag and drop on to a form and set your users loose, but again, it should not be too difficult for you to create panels & buttons to create your own. Depending your needs you may be able to use some pieces of the Office Developers Toolkit to help you get there.

Developing wizard UI - WPF

All in WPF:
Developing a wizard application, user has to answer a number of simple questions before brought to the main app. The main app is then prefilled with the information obtained from the wizard.
I started with a Window which I then planned to add usercontrols to. The main window would have the user control in the first row, then Next and Previous buttons to control moving between the controls in the second row. This way I could easily control the logic to switch between screens like:
WizardControl1.IsVisible = false;
WizardControl2.IsVisible = true;
But for some reason, user controls do not have setter for IsVisible. Hurray.
So then I thought I would just use seperate windows for each section of the wizard. The problem with this approach is that now when stepping between, the window opens in random positions, and by steppign through the wizard with next, the next window pops up randomly which is really distracting and frustrating.
So how can I develop a wizard properly? I don't get why this is so hard...not exactly rocket science... replacing text and controls and storing input after pressing next/previous!
Thanks
Check this link:
http://www.codeproject.com/KB/WPF/InternationalizedWizard.aspx
This is the article about building wizard in WPF by Josh Smith, it's seems to be nice pattern.
I found it's helpful for me, hope you'll too.
There is also an open source Avalon Wizard control on codeplex.
I'd probably aproach this using data binding and template selectors. Have the wizard form bind to a "WizardData" class, which exposes a list of "WizardPage" base classes.
The WizardData class can expose properties defining the correct info on the forms, and display a control for the main page that uses a template selector to determine the proper control to display based on the actual type of the particular wizard page.
It sounds like more work than it is, really. It also gives you the benefit of good separation between code and UI (all "work" is done by the WizardData and WizardPage classes), and the ability to test logic independent of the UI.
It's also a very WPF/MVVM way of approaching the problem.
I recognize this does not directly address your question, but I thought I'd mention it as a possible alternative. I've used Actipro's Wizard control with pretty good results, and when I have needed support, they have been very responsive. I am not affiliated with them in any way; I just like not having to write the plumbing to manage a wizard.
The property is called "Visibility".
I find that I do better when I dynamically add and removing controls rather than hide them.
I was looking for a Wizard solution too. I have the need to stick with stock WPF components so I implemented the wizard using a standard form and a tab control.
I only hide the tabs at runtime so there available in the IDE. At runtime just use Back, Next, Finish... to navigate thru the tab items
works good

C# WinForm Controls > Forms control to cycle through records?

Hey all. To be honest, I don't prefer MS Access as a relational database management system (RDBMS). Except, in the forms view part of Access, it had move-forward/jump-to-the-end and move-backward/jump-to-the-beginning buttons at the bottom right/left (respectively).
I was hoping to mimic that functionality in C# with my XML Editing Form. Is there already a form control (freely available) that does this?
I think you are looking for the BindingNavigator control, which is already included.
You haven't said what version of Visual Studio you are running. This answer assumes VS2008. There is a comprable control in VS2K5, but the name escapes me right now and I am no longer running VS2K5 on any of my PCs.

Categories