Hidden Button when run form - winforms

I designed a form using user-control
But when run the form the buttons are lost. I don't know.

I suggest using DevExpress LayoutControl to create such a layout. This way, your controls will be automatically positioned/resized and properly displayed regardless your form size, screen resolution, DPI settings, etc.
If you button is not visible because of the form size, LayoutControl will show a vertical scrollbar.

Related

How to disable an Angular UI-Grid

I'm using a UI-Grid control for user input in a big project at work. There are cases when the grids should be available in read-only mode, meaning that any clicks from the user should remain without effect.
I have searched the documentation as much as I could, but all I've come up with is the isRowSelectable property in the options of the grid. However, I am also using the grid as a treeView. And the expand/collapse buttons are still active.
Is there a possibility to make the grid read-only as if it had supported a "disabled" attribute the way that text inputs do? Is it possible to disable it altogether?
In the end, I have used a div acting as an overlay that I put right above the grid. It has a semi-transparent gray background, the exact dimensions of the grid, a higher z-index, a not-allowed cursor, and a no-op click handler.
Depending on whether the parent container of the grid (and the overlay) has a CSS class that says the grid is meant to be disabled, the overlay shows up and blocks the user from interacting with the grid. It's a simple solution that covers my needs.

How to prevent the keyboard cover over the UI in windows phone?

The project is based on wp 7.5.
I have a grid, and when the user swipe it, a textbox will reveal and the keyboard will show.
The function is ok, but there is a little bug, when the system keyboard show, it will cover over the textbox, so the user can't see the stuff they have entered.
how to solve it?
It would be best to position such a textbox so that it would not be obscured when the keyboard is shown. This is typically done by placing it at (or near) the top of the page.
Depending on how you've structured your XAML the default behaviour of the phone should scroll the content so that it is not obscured by the keyboard. Without being able to see you code I couldn't say why this isn't happening.
Alternatively you could but the page content inside a ScrollViewer and manually scroll it so that the TextBox is visible when it has focus.

Is it possible for WinForm controls (Panel,etc.) to grow like a webform control?

I'm converting an app from ASP.NET WebForms to WinForms. There is one asp.net page which contains a ListView/Repeater that contains several custom controls, which in turn contain a ListView with other custom controls. Basically the layout looks like a TreeView, but on each node/leaf there are few controls like comboboxes, etc.
When this is in ASP.NET, the page automatically lays itself out, so it is several screens tall - if I add 20 buttons into a Panel, it will grow and the browser will get scrollbars.
I'd like to do the same thing in a WinForms application - so I'll have a user control that will contain a lot of controls in a some variation of Panel (Flow, Table layout), and the controls might have another controls inside them, etc.
The problem is, that when I make winforms app, each control has specific height in the design time. I'd like some user controls to be able to grow with their contents - so they'll add up. In the main Form, there should be a vertical scrollbar, just like in the web browser when the generated page is taller than the screen.
I'd just like to get some general pointers in the right direction. Thanks.
Use Anchor and Dock container properties.
Yes, to expound on Anchor and Dock...try this
-Place a Panel on an empty form, and set its dock property to Top
-place a textbox in the panel, and Dock it to Full...it should fill the whole top panel
-Place a splitter on the form, and if not already docked correctly, set its dock to top
-place another panel below the splitter, and set its Dock to Fill
-place another textbox inside the lower panel and fill it as as well
Now you have a form with two resiable textboxes and will resize when the form does.
*you may have to set the textbox MultiLine property to true but not sure.
Hope this helps.
Anchor the controls to the parent. Anchoring all four sides will cause it to stretch.
If the Anchoring and Docking answers don't work for you, there is another option. It's not pretty, but you can access a control's properties and change them dynamically during runtime. You'd do something like: if(listBox.Items.Count > [yourVal]) listBox.height = [yourFormula] or something.
It's been a while since I've done a Win Form (and I don't have my IDE fired up at the moment) but I'm pretty sure there's even a ScrollPanel or other scrolling control that you can set on your form.
That said, when you're working with WinForms, the less scrolling you can make your users do, the better.

Use popup or dynamic C# winform screen (or other solution)?

On C# winforms project, I have a small table, a filter box, an Add button and a Done button grouped together, and they all fit together within 250x250 pixels. I only need to show these elements to the user when they press a button. I figured this could be done using a pop up modal screen or by making room on the main screen until the user presses the Done button.
I know a disadvantage to modal screens is that they can cause problems for users when/if they lose track of the modal screen and then they think the program's not responding.
The disadvantage I see for using a dynamic main screen is that the reshaping interferes with the overall layout. But maybe I could find a way to overcome that problem.
I'm new to all of this, so I wanted to ask opinions here. Thanks.
Put them all on a panel (or, even better, a custom control), style it to look nice, and then only show the panel on button click.
If you put them in a groupBox or FlowLayout panel possibly in the corner of the main screen and then set the visibility or even enabled on the entire control when they can or can't press the buttons works well.
disable until time they can edit.
groubB.enabled = true;
or
groubB.Visible = true;
When the user clicks the button, could you disable all of the controls in the main form and then place the panel in the center of the main form, on top of the other controls? Maybe make the panel a little larger with some decoration around it for emphasis. Then, when the user clicks 'done,' dismiss the panel and re-enable all of the controls in the main form.

Automatic proportionate resizing of Windows Form Components?

I have a Windows Forms form in C#.
It is just like a regular Windows GUI application. However I am facing problems making the different components on the form resize themselves according to the window size. I mean I do not exactly know which property of the component is to be changed.
I have a tabPage in the form. The tabPage contains a splitcontainer which has 2 panels in it.
The left panel contains a treeView and the right panel has components like radio buttons, textboxes, comboBox and buttons,etc
When I run my application and resize the window (either by dragging a corner of the window or by hitting the maximize button on top right corner) the Windows Forms form and the tabPage expand but the split container doesn't. It stays where it was. Also I want to anchor the split container so that if I shrink my window, the split cointainer still remain on top left. I am sorry I cannot put screenshots here.
Just set the Anchor property of the SplitContainer to Top, Left, Right, Bottom. Or experiment setting the Dock property to Fill.
Have you tried using a TableLayoutPanel? Windows Forms doesn't have great layout support (compared with, say, Java and WPF) but TLP works reasonably well - until you find a situation where it doesn't do what you want, and then it's a pain :)

Resources