Is there a way to 'lock' the last item in a ListView to always show? - vb.net

I am listing folders and folder sizes in a ListView for a VB.NET WinForm program I'm writing. I would like to total the folder sizes in the last entry of the ListView and 'lock' it show it always shows (even if scrolling through the list.
Is there a way to do this? I'd really like to avoid adding another control on the Windows Form to display the total.
EDIT:
Space is somewhat of an issue as I'm trying to keep this window small enough to work in a min screen resolution of 800x600 (I know, waaaaay not the standard, but I want to make this available to even those in the elderly community with problematic eyesight.
Thanks!
-JFV

There appears to be ways to do this in Webforms and WPF, but not in Winforms. You should probably use a text box. Any attempt to hack in a fixed totals row would most certainly be far more effort than the benefit obtained. It is certainly beyond my capabilities. Even the custom control shops like Telerik don't seem to do this.
http://www.telerik.com/products/winforms/gridview.aspx
If you're concerned about space, make the gridview a little smaller to accomodate the text box.

Related

Access custom right-click menus

I have written an app that makes extensive use of custom right-click menus on an Access form. The code works great and the user loves it, but lately I am having trouble making it work properly.
In earlier versions of Access it worked well, but newer version seem much more limited in how many items can be put in such menus. The documentation is silent on the matter, and nobody in any newsgroup has had any useful ideas, but I regularly get random error about stack space, out of memory, and general lockups when populating the menus. Doing a C&R used to help, but now even that is not enough, and some menus I can no longer populate at all.
I tried building an app that just built menus until it crashed, to get some idea of what the limits may be, and I am well below what that indicated, but the experimental app had nothing else, while the real app has a great deal else.
Is there any information on how much stuff can be put into these menus, and what the menus share space with? There may be something I can do another way to make more room for the menus. I tried moving all code out of the form, leaving only event stubs that called routines in standard code modules, but that did not help.
And how are they stored/activated? The app is MUCH slower to load when it has these menus, even though no code is running on start-up.
********** Edited to add this:
I use VBA to create a menu, like this:
Application.CommandBars.Add "RCStat", msoBarPopup, False, False
then add it to a control. like this:
Application.CommandBars.cboStat.ShortcutMenuBar = "RCStat"
I add controls (only popups and buttons) like this:
Application.CommandBars.Controls.Add(type:=msoControlPopup)
Application.CommandBars.Controls.Add(type:=msoControlButton, Parameter:="StatKod = 77")
It runs perfectly and the menu items work exactly as expected, except that it bombs after adding some number of controls. It doesn't seem to matter where I add them, just the total number of added controls hits some undefined threshold, and the app crashes.
I got the original code from Getz, Litwin and Gilbert, 2000 edition. Back then, it worked great. But as the versions advance and the app accumulates data, it is becoming less and less functional. However, there are only around 10,000 records, and the app itself is less than 100MB - nowhere close to any of Access's upper size limits.
Pete,
I've done quite a bit of work with shortcut menus, and created the Access Shortcut Tool about 5 years ago, but have never attempted a menu with so many controls although some have 3 or 4 levels.
I am not aware of any restrictions on the number of elements in the commandbars collection, but I find that shortcut menus with too many options, like lists and combo boxes with too many items, are difficult for users to navigate. I generally break these up into segments and use buttons in the form header to display the appropriate menu. Sorry I'm unable to provide anything more helpful.
Dale
We have a commercial product, Total Access Components, that includes as one of its 30 components a right click popup menu that can include icons and font styles.
Here's the info for the popup menu control: https://fmsinc.com/MicrosoftAccess/controls/components/popup-menu/
There's a free trial if you want to try it.

PivotItemHeader in two rows?

I'm currently building an app where I use a PivotControl as the standard navigation. I managed to style the headers now but after some thought I realised that I should probably make the whole app sizeable for different screens. Not every screen (especially in IoT scenarios) will be a full HD screen :D
Thats the current control:
My problem now is that when I make the screen and the PivotItem smaller it just cuts off the end of the pivots like you can see at the right of the picture.
What I would rather have is that when the PivotItem gets smaller I want the Headers to stack.
Like in this quickly googled example:
But I don't know how I should make that possible...
Does anybody have an idea?
What are you trying to build?
Could the content be organized in other way?
Pivots or similar controls (tabs, segmented controls etc) work best with few items that are important to the user and deserve the central stage.
The screenshot you added violates several UI best practices and I suggest you find an alternative to structure your UI that is user friendly.

XAML Table with sorting by column clicking in C++ UWP App - design and binding problems

I'm just beginning to build a Universal Windows Platform (UWP) C++ app using VS2015. I've worked in Android before and in .NET, but not UWP (and before you suggest using .NET, I'm using this as a project to get more C++ experience). I'm trying to add a screen to the app that will basically have a table with data that can be sorted by clicking on the corresponding column (one click for ascending, another to reverse. Click a different column header to sort by it instead).
Searching for help on this is a mass of craziness however. Half of the results recommend gridview but when I try to implement them parts of gridview turn out to be unavailable in the UWP platform and I can't seem to make it clickable. Others recommend listview but I want to have multiple columns that get sorted together on clicking of one, and keeping them in sync seems like it could get complicated. There are a variety of other options but I'm getting lost in the mix, particularly when some are then unavailable for UWP and MSFT seems to often have out of date documentation.
I'm also new to this XAML/binding approach and a bit lost with it. With an Android app version of this application I had an sqlite database from which I pulled a table that could be displayed to the screen. I was planning on a similar approach here but in that case what do I bind to? Do I query the database, build a table in memory, and then bind to that? That seems clunky and problematic if columns have different data types. And if gridview doesn't work, in what do I then display it?
That's a kind of vague and wide question I know, but this seems to be one of those instances where further research makes me more lost rather than bringing clarity so after a few hours of searching I thought I'd just ask for advice. This seems like it should be such a simple task that I must be doing something wrong. Any recommendations you have are most welcome!
There is no Control as you said in UWP.
Also it seems the data grid control to display data in a table is that you want. Please refer the DataGrid in this link: https://github.com/MyToolkit/MyToolkit/wiki/DataGrid. When we click the corresponding column the column can be changed.
We should be able to bind the date to the ItemsSource of the DataGrid and set the head name to DataGridTextColumn.
There is a sample for it, you should be able to see it in https://github.com/MyToolkit/MyToolkit/tree/master/src/SampleUwpApp.

Is it possible to resize a DateTimePicker or MonthCalendar Control in VB.net

Essentially I want to re-size my dateTimePicker control to fit its parent container. I have tried to do this both through the Control Editor and programmatically but I simply cannot get the drop down calendar to expand at all. So 2 part question:
a) Is this even possible to do?
b) Is there an easy-to-implement solution to having a good looking calendar that fits its parent field? (i.e. using a data grid or something similar)
Any help or knowledge is greatly appreciated!!!
The size of both objects is fixed and defined by the size of its font. Thus you might change its size by affecting the font size. This works fine with DateTimePicker but does not seem to work with MonthCalendar. After a quick research I have found a pretty curious recommendation on the MSDN forum: "you can consider third party MonthCalendar controls to meet your requirement temporarily".
There are quite a few third-party options (after a really quick search I found this) or you might even create one by your own. I personally haven't ever had any problem with the in-built controls but if the size is so important for you I guess that you would have to search/develop something by your own.
Further recommendation: rely on WPF which does contain a resizable control (DatePicker). I want to highlight here that I don't like WPF at all and that thus this recommendation is because I don't see any other option (inside .NET).

Washed Out Controls with VB.NET

I recently upgraded my system to Windows 7 Professional. Furthermore, I recently upgraded from VB6 to VB.NET and I've been working with forms and control under the new interface. Controls such as text boxes and tab controls are washed out and very difficult to see.
In my attempt to remedy the situation, I personalized my display by unchecking the box under "Windows Color" entitled "Enable transparency" and adjusting the Color Intensity slider all the way to the right. But no matter what I try to do, I still get washed-out form colors.
Is there a setting for adjusting the default form colors? What am I missing?
It seems to me that you have a couple of choices, all of which you probably won't like.
Change your Textbox BorderStyle from Fixed3D to FixedSingle, this will give you a more pronounced border around the textboxes (no such property on comboboxes though). This will also make your textboxes look a lot more 'flat', which you may not want.
Change either the background of your form or the background of your controls, thereby providing a better contrast between the two. Even slight variations on the same color would help.
Purchase (or make your own) custom controls that have built-in style changing abilities. I use the Telerik controls sometimes. They have the ability to let you change the UI Element's styles, including all kinds of colors and different borders and such. The issue with this option is a lot of these custom controls are overly expensive, although you can find decent ones for fairly cheap sometimes (I found a control set once that was pretty nice for $19).
Whatever you decide to do, you have to remember that your form will look different to users that are using different operating systems than what you're developing on. You noticed a big change when you went from (I'm assuming) Windows XP to Windows 7 right? You have to remember to test your application on all operating systems that your application will be expected to run on. You could design it beautifully on Windows 7 and it may look horrible on XP. You may be able to ignore OSs that are older than XP, but for the time being almost 50% of users still use XP (last I checked).
BTW, there is no setting for adjusting the default form colors... this just happens to be how forms look on Windows 7. I found it an adjustment when I went from XP to Win7, but you get used to it. I very rarely make the background of my controls the same color as the background of my form just because of this... oh, and don't go changing your display, you want to see what your users are going to see - otherwise you'll end up with something that only looks good on your computer. :)