.net 4.0 - Scrollviewer Scrollbar doesn't appear -
i not able scrollviewer working in wpf. guess doing wrong not able figure out what. made sure not using scrollviewer in side stackpanel. please note there 2 of them , none seems work.
i did try fix size of scrollviewer parent container restrict size, works, that's not want do. want make sure on resizing window, increase of size happens in containers appropriately.
here code, did change strings , paths part of client application:
<window x:class="common.views.someview" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wnd="clr-namespace:common" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:uc="clr-namespace:library.ui.core;assembly=library.ui.core" xmlns:cocls="clr-namespace:library.ui.core;assembly=library.ui.core" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" tooltipservice.showondisabled="true" dx:thememanager.themename="office2007silver" mc:ignorable="d" windowstartuplocation="centerscreen" resizemode="canresize" title="some validation" istabstop="false" height="365" width="792" d:height="700" d:width="1000"> <grid background="{staticresource backgroundbrush}" x:name="somegrid"> <grid.columndefinitions> <columndefinition width="*"/> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <menu name="mainmenu" background="{staticresource backgroundbrush}" grid.row="0" > </menu> <rectangle grid.row="1" style="{staticresource resourcekey=horizontalrectangleborderstyle}" /> <grid grid.row="2"> <grid.columndefinitions> <columndefinition width="auto"/> <columndefinition width="*"/> </grid.columndefinitions> <toolbartray horizontalalignment="stretch" flowdirection="lefttoright" background="{staticresource backgroundbrush}" grid.column="0" x:name="tlbartraymaster" > <toolbar background="{staticresource backgroundbrush}" style="{dynamicresource defaulttoolbarstyle}" width="auto" x:name="tlbarmasterimgtools" istabstop="false"> <button name="newtoolbarbutton" x:fieldmodifier="public" style="{staticresource resourcekey=toolbarbtnstyle}" command="{x:static wnd:myappcommands.myappinsertcommand}" commandtarget="{binding elementname=somevalidationgrid}" tooltip="insert (f5)" istabstop="false" isenabled="{binding relativesource={relativesource ancestortype={x:type wnd:mainwindowbase}, mode=findancestor},path=caninsert, mode=twoway}"> <image source="pack://application:,,,/common;component/images/new.bmp" style="{staticresource imageopacitystyle}" height="16" width="16" /> </button> <button name="savetoolbarbutton" x:fieldmodifier="public" tooltip="save (f2)" style="{staticresource resourcekey=toolbarbtnstyle}" istabstop="false" tooltipservice.showondisabled="true" command="{x:static wnd:myappcommands.myappsavecommand}" commandtarget="{binding elementname=somevalidationgrid}" isenabled="{binding relativesource={relativesource ancestortype={x:type wnd:mainwindowbase}, mode=findancestor},path=cansave, mode=twoway}"> <image source="pack://application:,,,/common;component/images/save.bmp" style="{dynamicresource imageopacitystyle}" height="16" width="16" /> </button> <separator/> <button name="searchtoolbarbutton" tooltip="search specific record (f4)" style="{staticresource resourcekey=toolbarbtnstyle}" istabstop="false" command="{x:static wnd:myappcommands.myappsearchcommand}" commandtarget="{binding elementname=somevalidationgrid}" isenabled="{binding relativesource={relativesource ancestortype={x:type wnd:mainwindowbase}, mode=findancestor},path=cansearch, mode=twoway}"> <image source="pack://application:,,,/common;component/images/edit.bmp" style="{dynamicresource imageopacitystyle}" height="16" width="16" /> </button> <separator/> <button name="canceltoolbarbutton" focusable="false" x:fieldmodifier="public" tooltip="cancel (esc)" style="{staticresource resourcekey=toolbarbtnstyle}" istabstop="false" tooltipservice.showondisabled="true" command="{x:static wnd:myappcommands.myappesccommand}" commandtarget="{binding elementname=somevalidationgrid}" isenabled="{binding relativesource={relativesource ancestortype={x:type wnd:mainwindowbase}, mode=findancestor},path=cancancel, mode=twoway}"> <image source="pack://application:,,,/common;component/images/undo.bmp" style="{dynamicresource imageopacitystyle}" height="16" width="16" /> </button> <button name="deletetoolbarbutton" x:fieldmodifier="public" tooltip="delete (shift+f2)" style="{staticresource resourcekey=toolbarbtnstyle}" istabstop="false" command="{x:static wnd:myappcommands.myappdeletecommand}" commandtarget="{binding elementname=somevalidationgrid}" isenabled="{binding relativesource={relativesource ancestortype={x:type wnd:mainwindowbase}, mode=findancestor},path=candelete, mode=twoway}"> <image source="pack://application:,,,/common;component/images/bin.bmp" style="{dynamicresource imageopacitystyle}" height="16" width="16" /> </button> <separator/> <button name="calculatortoolbarbutton" tooltip="activate calculator" style="{staticresource resourcekey=toolbarbtnstyle}" command="{x:static wnd:myappcommands.myappcalculatorcommand}" commandtarget="{binding elementname=somevalidationgrid}" istabstop="false" isenabled="true"> <image source="pack://application:,,,/common;component/images/calculator.bmp" style="{dynamicresource imageopacitystyle}" height="16" width="16"/> </button> <button x:name="printtoolbarbutton" style="{staticresource resourcekey=toolbarbtnstyle}" tooltip="view/print report" istabstop="false" > <image source="pack://application:,,,/common;component/images/print.bmp" style="{dynamicresource imageopacitystyle}" height="16" width="16" /> </button> <button x:name="helptoolbarbutton" visibility="collapsed" style="{staticresource resourcekey=toolbarbtnstyle}" tooltip="access on current subject" istabstop="false" > <image source="pack://application:,,,/common;component/images/information.bmp" style="{dynamicresource imageopacitystyle}" height="16" width="16" /> </button> <button x:name="searchparticipanttoolbarbutton" style="{staticresource resourcekey=toolbarbtnstyle}" tooltip="search participant/entity/member" istabstop="false" > <image source="pack://application:,,,/common;component/images/candle.bmp" style="{dynamicresource imageopacitystyle}" height="16" width="16" /> </button> <separator/> </toolbar> <toolbar x:name="mycompimagetoolbar" horizontalalignment="stretch" flowdirection="lefttoright" istabstop="false" width="{binding actualwidth, relativesource={relativesource findancestor,ancestortype={x:type toolbartray}}}" style="{dynamicresource defaulttoolbarstyle}" maxheight="1000" toolbartray.islocked="true"> <label x:name="toolbarmessagelabel" horizontalcontentalignment="center" foreground="#000084" fontweight="bold" margin="50,0,0,0"/> </toolbar> </toolbartray> <textblock grid.column="1" > <hyperlink navigateuri="http://mycomp-software.com" foreground="transparent" tooltip="http://mycomp-software.com"> <image source="pack://application:,,,/common;component/images/mycomplogo.bmp" verticalalignment="stretch" style="{staticresource defaultmenutabimgstyle}" /> </hyperlink> </textblock> </grid> <rectangle grid.row="3" style="{staticresource resourcekey=horizontalrectangleborderstyle}" /> <grid grid.column="0" grid.row="4"> <grid.columndefinitions> <columndefinition width=".5*"/> <columndefinition width="1"/> <columndefinition width=".5*"/> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <grid x:name="errorstringgrid" grid.column="0" grid.row="0" grid.columnspan="3"> <textblock x:name="errortext" text="{binding path=errorstring}" foreground="red" /> </grid> <grid x:name="sometovalidatesectiongrid" grid.column="0" grid.row="1"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <grid x:name="sometovalidatesection1grid" grid.row="0"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <textblock text="some validate" fontweight="bold" grid.row="0" horizontalalignment="center" /> <scrollviewer cancontentscroll="true" isdeferredscrollingenabled="false" verticalscrollbarvisibility="auto" width="auto" grid.row="1"> <grid horizontalalignment="center" verticalalignment="center"> <textblock x:name="txtblsomeblocktovalidate" foreground="{staticresource bluetextbrush}" height="42" horizontalalignment="center" /> <textblock text="some details:" fontweight="bold" horizontalalignment="center"/> <grid horizontalalignment="center"> <grid.columndefinitions> <columndefinition width="auto"/> <columndefinition width="*"/> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <textblock text="some1:" grid.column="0" grid.row="0" /> <textblock text="some1:" grid.column="0" grid.row="1" /> <textblock text="some1:" grid.column="0" grid.row="2" /> <textblock text="some1:" grid.column="0" grid.row="3" /> <textblock text="some1:" grid.column="0" grid.row="4" /> <textblock text="some1:" grid.column="0" grid.row="5" /> <textblock text="some1:" grid.column="0" grid.row="6" /> <textblock text="{binding some1}" grid.column="1" grid.row="0" /> <textblock text="{binding some1}" grid.column="1" grid.row="1" /> <textblock text="{binding some1}" grid.column="1" grid.row="2" /> <textblock text="{binding some1}" grid.column="1" grid.row="3" /> <textblock text="{binding some1}" grid.column="1" grid.row="4" /> <textblock text="{binding some1}" grid.column="1" grid.row="5" /> <textblock text="{binding some1}" grid.column="1" grid.row="6" /> </grid> </grid> </scrollviewer> </grid> <grid x:name="sometovalidatesection2grid" grid.row="1"> <expander name="myappexpander" isexpanded="false" height="auto" style="{dynamicresource expanderstyle4}" borderthickness="2" borderbrush="#ffba8b8b" opacity="1" istabstop="false" horizontalalignment="stretch"> <expander.header> <stackpanel horizontalalignment="stretch"> <textblock text="more information" horizontalalignment="center" textdecorations="underline" foreground="#0054e3"/> </stackpanel> </expander.header> <border borderthickness="1,0,0,0" borderbrush="#ffba8b8b" background="white" height="auto" horizontalalignment="stretch" verticalalignment="stretch"> <stackpanel x:name="panelbanks"> <textblock text="{binding additionalinfo}" horizontalalignment="center" height="61" /> </stackpanel> </border> </expander> </grid> </grid> <gridsplitter grid.row="1" grid.column="1" verticalalignment="stretch" horizontalalignment="center"/> <grid x:name="suggestedsomegrid" grid.column="2" grid.row="1"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <textblock text="suggested validation some" fontweight="bold" grid.row="0" horizontalalignment="center"/> <scrollviewer cancontentscroll="true" isdeferredscrollingenabled="false" verticalscrollbarvisibility="auto" width="auto" grid.row="1"> <grid scrollviewer.cancontentscroll="true" scrollviewer.verticalscrollbarvisibility="visible"> <textblock x:name="txtblsomeblockvalidated" foreground="{staticresource bluetextbrush}" height="42" horizontalalignment="stretch" /> <textblock text="some details:" fontweight="bold" horizontalalignment="center"/> <grid grid.row="1"> <grid.columndefinitions> <columndefinition width=".5*"/> <columndefinition width=".5*"/> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <textblock text="some1:" grid.row="0" grid.column="0"/> <textblock text="some1:" grid.row="1" grid.column="0"/> <textblock text="some1:" grid.row="2" grid.column="0"/> <textblock text="some1:" grid.row="3" grid.column="0"/> <textblock text="some1:" grid.row="4" grid.column="0"/> <textblock text="some1:" grid.row="5" grid.column="0"/> <textblock text="some1:" grid.row="6" grid.column="0" margin="0,10,0,0"/> <textblock text="some1:" grid.row="7" grid.column="0"/> <textblock text="some1:" grid.row="8" grid.column="0"/> <textblock text="some1:" grid.row="9" grid.column="0"/> <textblock text="some1:" grid.row="10" grid.column="0"/> <textblock text="some1:" grid.row="11" grid.column="0"/> <textblock text="some1:" grid.row="12" grid.column="0"/> <textblock text="some1:" grid.row="13" grid.column="0"/> <textblock text="some1:" grid.row="14" grid.column="0"/> <textblock text="some1:" grid.row="15" grid.column="0"/> <textblock text="some1:" grid.row="16" grid.column="0"/> <textblock text="some1:" grid.row="17" grid.column="0"/> <textblock text="some1:" grid.row="18" grid.column="0"/> <textblock text="some1:" grid.row="19" grid.column="0"/> <textblock text="some1:" grid.row="20" grid.column="0"/> <textblock text="some1:" grid.row="21" grid.column="0"/> <textblock text="some1:" grid.row="22" grid.column="0"/> <textblock text="some1:" grid.row="23" grid.column="0"/> <textblock text="some1:" grid.row="24" grid.column="0"/> <textblock text="some1:" grid.row="25" grid.column="0"/> <textblock text="{binding some1}" grid.row="0" grid.column="1"/> <textblock text="{binding some1}" grid.row="1" grid.column="1"/> <textblock text="{binding some1}" grid.row="2" grid.column="1"/> <textblock text="{binding some1}" grid.row="3" grid.column="1"/> <textblock text="{binding some1}" grid.row="4" grid.column="1"/> <textblock text="{binding some1}" grid.row="5" grid.column="1"/> <textblock text="{binding some1}" grid.row="6" grid.column="1" margin="0,10,0,0"/> <textblock text="{binding some1}" grid.row="7" grid.column="1"/> <textblock text="{binding some1}" grid.row="8" grid.column="1"/> <textblock text="{binding some1}" grid.row="9" grid.column="1"/> <textblock text="{binding some1}" grid.row="10" grid.column="1"/> <textblock text="{binding some1}" grid.row="11" grid.column="1"/> <textblock text="{binding some1}" grid.row="12" grid.column="1"/> <textblock text="{binding some1}" grid.row="13" grid.column="1"/> <textblock text="{binding some1}" grid.row="14" grid.column="1"/> <textblock text="{binding some1}" grid.row="15" grid.column="1"/> <textblock text="{binding some1}" grid.row="16" grid.column="1"/> <textblock text="{binding some1}" grid.row="17" grid.column="1"/> <textblock text="{binding some1}" grid.row="18" grid.column="1"/> <textblock text="{binding some1}" grid.row="19" grid.column="1"/> <textblock text="{binding some1}" grid.row="20" grid.column="1"/> <textblock text="{binding some1}" grid.row="21" grid.column="1"/> <textblock text="{binding some1}" grid.row="22" grid.column="1"/> <textblock text="{binding some1}" grid.row="23" grid.column="1"/> <textblock text="{binding some1}" grid.row="24" grid.column="1"/> <textblock text="{binding some1}" grid.row="25" grid.column="1"/> </grid> </grid> </scrollviewer> <stackpanel orientation="horizontal" grid.row="2" > <button x:name="btnacceptsuggested" margin="0,0,10,0" istabstop="true" tabindex="5" height="28" width="132" click="btnacceptsuggested_click"> <stackpanel orientation="horizontal"> <image name="imgacceptsuggestion" source="pack://application:,,,/common;component/images/some1.bmp" margin="0,0,5,0"/> <textblock name="txtblacceptsuggested"> <underline>a</underline>ccept suggested </textblock> <accesstext text="_a" height="0" width="0"/> </stackpanel> </button> <button x:name="btnvalidatesome" margin="0,0,10,0" istabstop="true" tabindex="5" height="28" width="132" click="btnvalidatesome_click"> <stackpanel orientation="horizontal"> <image name="imgacceptsuggestion1" source="pack://application:,,,/common;component/images/some1.bmp" margin="0,0,5,0"/> <textblock name="txtblvalidatesome" grid.column="1"> show me <underline>m</underline>ore </textblock> <accesstext text="_m" height="0" width="0"/> </stackpanel> </button> <button x:name="btnundo" margin="0,0,10,0" istabstop="true" visibility="collapsed" tabindex="5" height="28" width="132" click="btnundo_click"> <stackpanel orientation="horizontal"> <image name="imgacceptsuggestion2" source="pack://application:,,,/common;component/images/some1.bmp" margin="0,0,5,0"/> <textblock name="txtblundo" grid.column="1"> <underline>u</underline>ndo </textblock> <accesstext text="_u" height="0" width="0"/> </stackpanel> </button> <button x:name="btnoverridesuggested" margin="0,0,10,0" istabstop="true" tabindex="5" height="28" width="140" tooltip="override suggested validated some." click="btnoverridesuggested_click"> <stackpanel orientation="horizontal"> <image name="imgacceptsuggestion3" source="pack://application:,,,/common;component/images/some1.bmp" margin="0,0,5,0"/> <textblock name="txtbloverridesuggested" grid.column="1"> <underline>o</underline>verride suggested </textblock> <accesstext text="_o" height="0" width="0"/> </stackpanel> </button> </stackpanel> </grid> </grid> <rectangle x:name="rectrowborder_row05" grid.row="5" style="{staticresource resourcekey=horizontalrectangleborderstyle}" /> <stackpanel grid.row="6" orientation="horizontal" verticalalignment="center" margin="0,5,0,5"> <button x:name="btncancel" margin="0,0,10,0" istabstop="true" tabindex="5" height="28" width="132" iscancel="true"> <stackpanel orientation="horizontal"> <image name="imgcancel" source="pack://application:,,,/common;component/images/cancel.bmp" margin="0,0,5,0"/> <textblock name="txtblcancel" grid.column="1"> <underline>c</underline>ancel </textblock> <accesstext text="_c" height="0" width="0"/> </stackpanel> </button> </stackpanel> </grid> </window>
sorry huge code, that's have. also, please leave comment downvotes.
Comments
Post a Comment