Scroll bars for Excel CustomTaskPane developed using VSTO - vsto

I have an add-in, developed using VSTO, that displays a custom task pane in Excel. This custom task pane holds a user control containing tree-view and other controls. I enabled AutoScroll for the user control and can see the traditional windows scroll bar when ever i re-size the control. However, i want the scroll bar to be similar to the scroll bars that exist in Thesaurus CTP in Excel 2013,when the CTP is in floating position and re-sized to smallest size, (i cant post images as i have reputation below 10). can any one provide pointers for this?
Also is there any way to restrict the minimum size of CustomTaskPane ?

Hello Guruteja,
You can handle the Resize event of the Control class to control the size of your form and set the min size programmatically.
It looks like you need to develop a custom control to imitate the built-in one. Or try searching for any third-party Windows Forms controls.

Related

Click and drag selection box in UWP

Is it possible to implement mouse click and drag selection box in GridView UWP Windows 10. Should it be done through simply drawing a rectangle, calculating coordinates of its points and evaluating position of other objects inside this box? Or are there some other ways?
Could you give a bit of sample code or a link?
The Universal Windows Platform does allow for Drag-And-Drop behavior. This includes drag from app and drop outside of app, drag and drop inside the app, and drag from outside the app and drop in the app.
The way to do this very simple (with room for heavy customization if you feel like it is needed): UWP XAML controls have a CanDrag and AllowDrop properties. The former is just a property of whichever control you're dealing with, the latter is an event that needs to be handled properly via code. If you want to further customize your app you can also handle the DragOver, which handles behavior when a dragged item is over a drop area but has not been "released" yet.
For further details and a bit example code please read Microsoft's own documentation for Drag-And-Drop. For a more built up example, you can check out the following Github repo.

How to implement the Windows 10 OneNote Menu in Universal Windows Platform app

I would like to implement the OneNote app menu in my own UWP app. In the closed state, the menu only shows the 'hamburger' button, but when clicked a menu pane slides in from the left.
I have tried to use the SplitView, but it doesn't allow me to set the width to 0 when collapsed, always showing a narrow line on the left side. I also considered using the 8.1 Flyout control, but that doesn't see to animate the correct way.
So, what's the correct way to implement the OneNote menu behavior?
You need the SplitView, but don't mess with the width of its pane.
Instead, set the DisplayMode to Inline (or Overlay) and toggle the IsPaneOpen property.

.Net Form Layout - create Chat UI like facebook or google hangouts

I want to create an application and chatting is involved. I am currently struggling to format existing controls or to create a control with the following conditions:
a container is docked to the main form's bottom
inside of that container, a button can be used to toggle a chat
component (e.g. text edit) to become either visible or invisible
if visible, the chat component is aligned with the button that was
pressed but does not force a resize on the container of the button
So basically I want to achieve a facebook or google hangouts like chat layout in vb.net that can also scale dynamically according to the current window size. Nevertheless it should always stick to the bottom.
Please keep in mind that this question is not about making the chat work but only the layout/design problem I am facing.
My current approach is the following:
FlowLayoutPanel docked to bottom with buttons
RichEdit as placeholders to simulate the chat component
My current layout
Is there an easier way to do what I want to do?
Set the anchors to the bottom of the page/panel.
On the designer, click the control you want to edit, find the Anchor property and change it to bottom (and left/right/top, whatever you'd like).

disabling Windows phone map control

My quesiton is: i have a windows phone 8 app - it has a Map Control on a page that shows the user's position.
We want to allow the user to disable the map control so it looks greyed out and disbaled and doesnt update (to save bandwith etc)
What would be the best way of doing this?
I would simply draw a control with semitransparent background on top of the map. thus all touch events would be stuck in the control, but the map would be visible under it still.

Detect end of GridView / ListView in Windows Store 8.1 App

Both GridView and ListView have a nice "bounce-effect" when you try to scroll beyond the begin or end.
Some applications (on other platforms) use this "drag-beyond-end" gesture as a trigger for some actions, like loading more items.
How can I detect this "state" (=user is at the begin/end and tries to scroll beyond that) in Windows Store App using XAML/C# ?
The rubber-band effect cannot be detected by code in a Windows 8 app (verified with the XAML controls team).
One way you could do that would be by handling all the inputs and the rubber-band effect yourself, but that is a bit of work, it reduces scrolling performance and requires manual handling of input on any list elements as well, so I would only recommend it as a last resort.
Also note the problem of the mouse input scenario since mouse scrolling doesn't involve this pull-beyond-edge behavior.
If you just want to load more items when you reach the end of the GridView, implement the ISupportIncrementalLoading interface with your collection derived from ObservableCollection<T>. See the answer here Load more items on grid view scroll end.