Custom CommonDialog/PrintDialog Newbie Question - visual-studio

I am trying to create my first custom Print Dialog in C#. I found some samples online that I'm working with to do this.
What I want to do is to put a button underneath the Properties button in the upper right corner. The code samples I have seen so far put new controls on the bottom of the Dialog relative to the position of the OK and Cancel buttons. Those code samples allow one to retrieve the handle of the OK or Cancel buttons because they're universal constants in Dialog controls. Fair enough, but how would I go about getting the handle on the Properties button so I could insert my button underneath?

You can use SPY++ to figure out the control Id of any control, those ids a solid across Windows versions. You can read here (old but still relevant) on how to use SPY++ to obtain control Ids.

Related

Windows Phone - Loading/Saving panel

I often need loading panel, which shows an indeterminate progressbar and a textblock in fullscreen mode. I do this with a Grid and just set the visibilty so visible. Instead of copy source code from page to page, I want to re-use it as a control. Is there already an existing control I can use?
Create your own usercontrol is the best way if you want to reuse the control. There are a lot of guides on Google, search for "custom user control silverlight" or something similar.

WinRT Settings Charm. Elements overlayed by on screen keyboard

I'm developing for Windows 8 (WInRT) and have problem with settings charm. Settings popup is based on Microsoft SDK settings charm. Settings panel is Popup. Content is wrapped by ScrollViewer -> Grid -> StackPanel. In StackPanel I have input fields. when I trying to fill last of them on screen keyboard overlaying it and I cant see field and cant scroll to it. Is there any way to see it and to scroll to it automatically?
Seems like the popups on Windows 8 suffer from the same problem as they did on Windows Phone in that when you put a TextBox on one of them - it does not get pushed up together with all the other content as it does when it is not in a popup.
My solution to that would be to not use popup for input fields and instead go for a layout that you can manage yourself.
By default the app has a Frame control at its visual root. You can modify it for example by putting your own UserControl in there (I usually call it AppShell) which has the Frame used by all pages, you can have a layer for popups, log in screens, the extended splash screen etc.
To solve your problem you would need to put your charm's UI inside of such layer instead of in a popup. Then the build-in mechanism that pushes all the UI up when the on-screen keyboard would otherwise obstruct the view of your TextBox should just start working again.
*EDIT
A simpler solution might be to make sure your settings panel popup is parented in your visual tree - e.g. by adding it as a child element to a root grid of your app or page. It turns out that in that case its content does get pushed up when the OSK shows up.
Take a look at this post
It's a popup wrapper (turns user controls into popups) that takes care of the keyboard appearing and adjusts the size of the popup (and thus the user control) accordingly.

How to create a tab control where every tab item is connected with a different listbox

How can we create a tab control where every tab item is connected with a different listbox, so the view are different for every tab? I want to know what is the best solution for this, I tried two approaches:
All logic of tab activity is built in one class that is
mainPage.xaml.cs
For every tab I create a new class and call it when a tab event
fires
What is the best solution and if answer is second then what is procedure to add different view but the all the tab appear every time?
Or provide a link where I can get a full example of tab control usage in Windows Phone 7.
Windows Phone does not provide a TabControl implementation, however, it does provide the unique Pivot control, which provides the same level of functionality and is documented on MSDN. You might also find this post by Jeff Wilcox useful: http://www.jeff.wilcox.name/2010/08/looking-ahead-at-panorama-and-pivot/
Here is an article I wrote on how to use the TabControl in a Windows Phone Silverlight application. It does not really abide the current UI guidelines, but it works. All you need to do is use ListBox controls as proper child elements.

MFC: Scrollable Panel/Sub-windows containing controls

Whats the best way to create a 'scrollable panel' in MFC (C++) ? In the past I have displayed different windows "attached" or "on top" of my main dialog window as a means of display different pages of an application. What I want to do this time is create a panel of controls that can be scrolled (because the virtual size of the panel is bigger than the size of the panel itself).
Can anybody recommend any good articles or tutorials on how best to do this?
Thanks
You can create an independent scrollbar control on the side of your dialog. Respond to the messages in the dialog to move your controls. Since the child windows will crop themselves to the parent client area, feel free to move them completely off the dialog as they scroll off the page.
If you place the controls in a CScrollView or a CFormView they will be automatically scrollable inside the view area.

scroll tip in list control

In Windows 7, the explorer shows a scroll tip in detailed view like this:
alt text http://i.msdn.microsoft.com/Dd378445.scrolltip%28en-us,VS.85%29.jpg
This image is taken from this MSDN page, but there's no information there on how to activate this for a plain list control.
I'd like to get my list controls to do the same, but I can't figure out how to do this.
There's the LVN_BEGINSCROLL and the LVN_ENDSCROLL notification message, but no LVN_SCROLL message which is sent while scrolling so I could implement my own scroll tip and updating it while scrolling.
I haven't found any window styles or settings for the list control to activate this feature either.
But since Windows 7 can do this, it must be possible somehow. Anyone got an idea how I could implement/activate this feature?
You could probably subclass the listview and catch WM_VSCROLL
A somewhat related article in MSJ implemented "scroll tips" and deferred scrolling

Resources