I've searched but couldn't find the answer or even a hint about this problem I'm having. The right side of a textbox truncates the text. The textbox is set to be multiline and wrap text. The odd thing is, if I highlight the text and then copy/paste into Notepad ++, the 'missing' text is actually there.
This leads me to believe that it is a visual issue. I've tried everything I can possibly think of. The textbox's right border is showing 0.0in and the row in which it sits is set at 10.5in.
The only thing I was able to do to make it work was to make the row longer than 10.5in but that creates an issue with printing.
Does anyone happen to have any more suggestions?
Related
I made a virtual keyboard in C# Visual Studio, but I have problems when I try to change the dimensions.
This is the virtual keyboard:
and this is when I try to change the dimensions:
I lose the buttons. I found a tutorial where he uses a rectangle.
In this photo is the "main" function, and after I called this function for every button from list (I make a list with all the buttons), I lose all the buttons. Only shift/caps remain because they are special characters.
Your best bet is to anchor the buttons and enable auto size then set the AutoSize mode to grow and shrink.
If all else fails, writing a function to change the font of each button to change down in size according to the size of the form is your only option.
What the problem most likely is is that the font sizes for the individual keys is too big and when you re-scale the keyboard the font doesn't change to compensate for the scaling down in buttons.
(EDIT)
Also, next time you make a post on these forums try to keep up with the formatting and try to use more accurate descriptions of the problem as well as the properties of the buttons because all of my possible solutions are just going off a whim based on prior experience. Thanks
(EDIT EDIT)
Ok I just saw the resizeControl method, I didnt see that before, however, my previous edit still applies. Properties for the buttons would be much appreciated to help answer your question. Also, try to edit the image to instead of being an image, just use the markup language like so:
//Like this
To make it easier for us to use and help debug, if you need to know how, just add 4 spaces before your code. Again, thanks
I have a wpf application which has a text box in which I can write a text value to just fine the first time around. If I exit the window the text box is in and then reopen that same window the box can no longer be found by the testing, despite being enabled, and clearly visible on my screen.
I looked at the values of the box, the x,y = -1,-1 and height,width are also -1,-1 which is confusing seeing as the box is completely visible.
I know what the text in the box will be, is it possible to search for a text box with that as a workaround?
I'll keep researching this but any feedback is appreciated :)
EDIT: Upon further study there is a second field on top of the original field providing an initial explanation as to what the box is for ("Enter field value").
Maybe this is a wpf error?
I found that the box wasn't being updated properly on the UIMap. This can be solved by setting the application windows SearchConfinguration (only in the specific test) to always search like so:
UIMap.ApplicationWindowName.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
Apparently this can cause a performance hit but I haven't noticed!
I would look at the SearchProperties and FilterProperties of the text boxes, I suspect that two have been found and the wrong one is chosen. Or, it may be that the second window has some different values for the properties used to identify the windows.
One idea: Run the program again manually, move the first window with the text box to one corner of the screen, then close that window. Cause the window to be reopened and move it to the opposite corner of the screen; leave the window on display. Open the UI Map of the Coded UI test and use the Locate command to find the box - it should draw a blue line around the text box.
Another idea is to call FindMatchingControls (as shown in Coded UI conditional check on a method is not working) then use the properties (such as some of x, y, height, width) to select the wanted control.
I doubt if it is a WPF error, but it may be an error in the WPF application where it is not clearing up properly when the first window closes.
There appears to be a bug in the Win32 edit control that WinForms.TextBox wraps:
Open Notepad.
Make sure that the bottom scrollbar is visible (you may have to turn off word wrapping).
Enter a long line, so that the bottom scrollbar activates.
Delete some of this text, so that the line becomes much smaller.
Now the bottom scrollbar doesn't update to reflect the fact that the line is now much smaller.
In fact, even if you resize the window, the scrollbar still seems to think that we have a huge line. The only work-around seems to be enabling and disabling word wrapping.
Can anyone suggest a way to fix this from a WinForms .NET app?
Another workaround is when the additional text is deleted .. cut the remaining text and then paste it again. That makes scroll bar disappear.
You can hit CTRL+A to select all text then CTRL+X to cut and CTRL+V to paste.
Just an idea.
I have a WinForm that mysteriously changes height seemingly randomly. Usually everything is evenly spaced, but sometimes when I look back at my form, it has a large margin under the bottom button.
screenshot: http://min.us/mv00PK
This is pretty weird, I'm not sure what's going on here, but I hate changing it back each time it happens. Whatever the case may be, I'm not manually changing the height so that gap is there, but could I be doing something else that causes this to happen?
Please let me know if you have an idea of what's happening here, thanks!
when I look back at my form, it has a large margin under the bottom button
There are about a dozen factors involved (FormBorderStyle, ScaleMode, FontSize, Anchors, Docking, ...).
You mentioned exactly 0 of them.
I'm not sure what's going on here
Neither are we.
Override or subscribe to the form size changed event, and set a breakpoint in it in the debugger. This will let you know what operation it is that causes the form to change size. From there, you should be able to debug it.
If you find the gap appearing consistently, yuo can consider setting the MaximumSize property of the form to the desired size. That should prevent it from growing.
I have a simple ListView, essentially creating a MxN grid. "FullRowSelect" is off. Essentially we have a grid of cells.
I am trying to find out of the mouse is over a cell that contains an Item, and if so, what Item it is.
GetItemAt(...) is close to what I want to do, but not quite. If there is text in the "cell", then GetItemAt() returns the item. The problem is that if it is over the cell, but not actually over the text in the cell, then it returns null.
I am stumped. Can anyone help me?
There is a bug/"feature" of the ListView concerning hit testing.
If FullRowSelect is false and the point is over cell 0 but not on
the text or icon, GetItemAt() will not register a hit.
One hackish way around this is to intercept the low-level LVM_HITTEST message, turn on FullRowSelect, do the normal LVM_HITTEST processing, and then turn FullRowSelect off again. This sort of works but can mess up the tool tip on the
underlying control.
An easier way is to use ObjectListView (an open source wrapper around a .NET ListView), which has already solved this (and quite a few other problems) with the standard ListView.
I am the author of this control so, yes, I am biased, but not necessarily inaccurate :)