showing large data in small area - winforms

I have a CRM application(winform application),which fetches customer info from db and shows it in a small area using scroll option.But new requirement has come that it will show 65 fields instead of 45 (that was shown earlier) that too in a category wise.Here real problem is i have to show all the data at at a time without scrolling in that small area.
I tried to use pop up but that way Agent cant input data in main form while looking at the pop up box.
So friends do you have any better idea how to achieve this without using any third party controls.
Thanx in advance

You can group the fields in different tabs.
From MS documentation:
To add a tab in the designer
Drag a TabControl from the Windows Forms tab of the Toolbox to the designer.
In the Properties window, click the Add Tab link.
- or -
In the Properties window, click the Ellipsis button (Aa984280.vbellipsesbutton(en-us,VS.71).gif) next to the TabPages property to open the TabPage Collection Editor. Click the Add button.
This way you'll have more space to show the fields, but still using the same area.

Related

How to Detect The Clicked Control of a WPF App Outside the Application

Scenario: I have one more more WPF applications opened. I cannot change the source code of these apps. My purpose is Whenever user clicks any control (button, combobox, textbox etc.) on these apps, I want to know which control / element is clicked, and log it. Simply obtaining the name of the element would be enough like so: "App1 - button3 is clicked." or "App2 - button1 is clicked". If possible, I want to achieve this for both Winforms and WPF apps, but WPF is more important.
Any way to do accomplish this in the background is OK.
I tried examining and using source codes of snoopwpf (Since it is able to detect the element under the mouse cursor by pressing CTRL+SHIFT), but I wasn't able to achieve my purpose. I could not get the elements in different AppDomains. (AppDomainHelper.GetAppDomains() also returns null)
I looked a little into pywinauto module, however couldn't find such a functionality.

Changing the data in a specific area of a window, Caliburn.Micro, WPF

Here is my need. I think a user control is what I need but I am not sure if its the best or even how to use it.
What I have. My main window has a menu with a "help" menu. When you click help, a new window opens, I have a column, At the top of the left column has a drop down box of "Major Titles", a ListBox below that that populates based on the combo box selection. This will be about 25% of the window width. All this works.
When I select an item in the list box a page,contentControl or user control is displayed to the right with verticle scroll bars so the window does not need to resize, the information I display that changes based on the list box selection will have only visuals like text block, label, images. There will be no user interaction with the changeable pages Just formatted Data.
What would be the best way to approach this? Can anyone offer an easy example?
I was thinking of using a user control and change the user control based on the selected list box item.
Ok, I got this figured. After reading a lot of posts and blogs. Seems people sometimes want to make things more complicated then they actually are.
What I wanted, a permanent list box on the left 1/6 of the window. The list box contained string names for "help subjects". On the right 5/6 of the screen I added a groupbox with header and in group box I added a usercontrol. The content of the control is bound to a property called 'ActiveView'. The list box selected value property is bound to 'SelectedListItem' property.
When you change it set 'SelectedListItem' a method is called 'SetActiveControl'. SetActiveControl has a switch/case that sets like in the example:
``Case "Setup":
ActiveView = new SomeSelectionViewModel();
Break;
I have created a user control in a folder inside the Views folder called HelpControls, I also created the same folder in ViewModels. I have classes matching the user controls and everything is bound together.
Ultimately when you click the list box item, the associated ViewModel is called and in turn populates the user control on the window with the appropriate data.
I need to later look into, using one ViewModel for all the controls, I know that can be done using Cal:Model.View = ViewModel name. In the xaml of the control. I'm just not sure how to call the appropriate user control view when an item is selected. Either way this would become a view first design and I thought I read, Caliburn. Micro was intended as a ViewModel first design.

Where is the Tab Order Assignment dialog in Visual Studio 2012?

For as long as I can recall, Visual Studio has had an integrate dialog that allows you to easily organize the tab order of your controls.
I've just created my first VS 2012 WinForms project, added all of my controls and went to find the Tab Indexing dialog, and it appears to be missing from Visual Studio.
I found this MSDN article which states that I can open this dialog by going to FORMAT>Tab order. The problem is that there is no Tab Order option on my FORMAT menu. Alternatively, the documentation states th at Ctrl+D should open this dialog. It doesn't.
Another alternative is to select the VIEW>Tab Order menu option. This method causes Tab Index boxes to hover over your controls. You can subsequently click on your controls, one at a time, in the order in which you want them to tab, to set the tab order.
This isn't acceptable because my form contains numerous panels and group boxes that cover one another. It is impossible for me to click-through my controls because many of them are no longer visible in the designer.
Is there an easy way for me to setup the tab order of my controls like there previously use to be within older versions of Visual Studio?
It is still available, you just need to add it back to the View menu. Tools + Customize, Commands tab, Menu bar = View. Select the menu item in Controls where you want to insert it, say the bottom one. Then Add Command, Category = View, Commands = Tab Order.
Your memory of this command does sound a bit hazy, it was never on the Format menu and its never been a dialog. If you want to put it on the Format menu then you can, just pick the Format menu bar in the Commands tab. You can't make it a dialog though, it numbers the controls in the designer view. Some odds that you actually remembered the View + Document Outline command.
Go to your alignment toolbar. At the end, click the tiny little "Add or Remove Buttons" down arrow. Click the "Add or Remove Buttons" button, and look towards the bottom of the list. You should see Tab Order. Click on that and it will be added to the alignment toolbar.
I found this to be very useful http://msdn.microsoft.com/en-us/library/csz6b8x8.aspx
It allows you to simply click on the various controls in the order that you want them to tab through. You do this while you are in the "Show tab order" mode as described above; the tip from Elton about adding the icon to a toolbar makes it easy to toggle the mode.
Ctrl-doubleclick the first control, then click subsequent controls, and press Enter to terminate. You can also start on the Nth control if you Ctrl-click the one before it, then click in order as normal.
(VS Express 2013)
The Tab order tool from the view menu disappears in some cases. For example, if you clikc a text box, then go to its properties, the tab order option will not show. You must select a control, then immediately go to the view menu and choose tab order.
You can click through your controls with the Document Outline view. If they all have the same TabIndex value, their Z-order will be used as tab order. The Z-order can be changed also with the Document Outline view.

Custom Wizard Control in WPF to add and remove UserControls?

How best can I create a Wizard control in WPF. My tak is; first I have a Wizard Controller UserControl, that contains two buttons, i.e. Back and Next, then I have start off with two other UserControls with forms for users to fill in and click next step to the next form etc... What I woud like to know is how I could inserted this usercontrols and validate my current object before going to the next form. What can I use to get the next and previous events or is there a better solution for this?
Im still learning WPF, and am working on WinForm project atm, so sorry for any WinForm references in this.
The wizard control could contain a reference to each usercontrol the wizard will display. The wizard will add all these controls to itsself controls.add(_userControl1). Each control has its visible property set to false.
The wizard could also contain a private enum with a list of control names, i.e.
private enum CurrentControl
{
_MyControl1,
_MyControl2,
_MyControl3
}
Wizard control keeps a reference to the current displayed control CurrentControl _currentControl = CurrentControl._MyControl1; Have a UpdateDisplay() method, which based on the _currentControl will only make that one control visible.
Then when you click on Prev/next buttons, it updates the _currentControl varible based on its current value, calls UpdateDisplay() to show th enext control.
This way you have a reference to all your user controls (and thus the data they contain), and thus you can validate the content and your wizard can go back and forward through them by using the buttons on the wizard, and the logic in the wizard showing and hiding the controls.
You might be interested in the EmailClient (ViewModel) sample application of the WPF Application Framework (WAF). It shows how to create a Wizard with the Model-View-ViewModel pattern and it contains validation logic which disables the Next button when the user input is not valid.

Passing data from Main Window to page

I have created a ribbon (R:ribbon) inside my main window in WPF. And I added a frame to the same window (bottom to the ribbon) and display pages inside the frame according to the buttons click on the ribbon.
1.I have ribboncombobox on the ribbon , I want to get particular value in that combobox and display that value in a page that is display in the frame.
2.Also need to transfer data from one page to another.
This is window based project. Don’t know is this possible to do. If it is possible please guide me with some sample code. If this concept is wrong please let me know how to do this.
Thank you very much.
Have a ViewModel class for the MainView. Create properties for the corresponding data to be transferred and bind them.

Resources