Scroll Bar Controlling multiple movieclips?

Instead of a scroll bar just controlling one movieclip..How could we get it to control multiple movieclips?
public class MainScroll extends Sprite
          //private var mc_content:Sprite;
          private var content_mc:MovieClip;
          private var content2_mc:MovieClip;
          private var _scrollBar:FullScreenScrollBar;
          //============================================================================================================================
          public function MainScroll()
          //============================================================================================================================
               addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
          //============================================================================================================================
          private function init():void
          //============================================================================================================================
               SWFWheel.initialize(stage);
               //_copy = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque quam leo semper non sollicitudin in eleifend sit amet diam. "; 
               content_mc = new mc_content();
               content2_mc = new mc_content2();
               content_mc.x = 110;
               content_mc.y = 29;
               content2_mc.x = 10
               content2_mc.y = 29
               addChild(content_mc);
               addChild(content2_mc);
               // Scrollbar code 
               // Arguments: Content to scroll, track color, grabber color, grabber press color, grip color, track thickness, grabber thickness, ease amount, whether grabber is "shiny"
               _scrollBar = new FullScreenScrollBar(content_mc, 0x000000, 0x408740, 0x73C35B, 0xffffff, 15, 15, 4, true);
               addChild(_scrollBar);
          //============================================================================================================================
          private function onAddedToStage(e:Event):void
          //============================================================================================================================
               init();
               removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);

Ok,
Here is that code:
     import flash.display.*
     import flash.events.*;
     import flash.geom.Rectangle;
     import gs.OverwriteManager;
     import gs.TweenFilterLite;
     public class FullScreenScrollBar extends Sprite
          private var _content:DisplayObjectContainer;
          private var _trackColor:uint;
          private var _grabberColor:uint;
          private var _grabberPressColor:uint;
          private var _gripColor:uint;
          private var _trackThickness:int;
          private var _grabberThickness:int;
          private var _easeAmount:int;
          private var _hasShine:Boolean;
          private var _track:Sprite;
          private var _grabber:Sprite;
          private var _grabberGrip:Sprite;
          private var _grabberArrow1:Sprite;
          private var _grabberArrow2:Sprite;
          private var _tH:Number; // Track height
          private var _cH:Number; // Content height
          private var _scrollValue:Number;
          private var _defaultPosition:Number;
          private var _stageW:Number;
          private var _stageH:Number;
          private var _pressed:Boolean = false;
          //============================================================================================================================
          public function FullScreenScrollBar(c:DisplayObjectContainer, tc:uint, gc:uint, gpc:uint, grip:uint, tt:int, gt:int, ea:int, hs:Boolean)
          //============================================================================================================================
               _content = c;
               _trackColor = tc;
               _grabberColor = gc;
               _grabberPressColor = gpc;
               _gripColor = grip;
               _trackThickness = tt;
               _grabberThickness = gt;
               _easeAmount = ea;
               _hasShine = hs;
               init();
               OverwriteManager.init();
          //============================================================================================================================
          private function init():void
          //============================================================================================================================
               createTrack();
               createGrabber();
               createGrips();
               addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
               _defaultPosition = Math.round(_content.y);
               _grabber.y = 0;
          //============================================================================================================================
          public function kill():void
          //============================================================================================================================
               stage.removeEventListener(Event.RESIZE, onStageResize);
          //============================================================================================================================
          private function stopScroll(e:Event):void
          //============================================================================================================================
               onUpListener();
          //============================================================================================================================
          private function scrollContent(e:Event):void
          //============================================================================================================================
               var ty:Number;
               var dist:Number;
               var moveAmount:Number;
               ty = -((_cH - _tH) * (_grabber.y / _scrollValue));
               dist = ty - _content.y + _defaultPosition;
               moveAmount = dist / _easeAmount;
               _content.y += Math.round(moveAmount);
               if (Math.abs(_content.y - ty - _defaultPosition) < 1.5)
                    _grabber.removeEventListener(Event.ENTER_FRAME, scrollContent);
                    _content.y = Math.round(ty) + _defaultPosition;
               positionGrips();
          //============================================================================================================================
          public function adjustSize():void
          //============================================================================================================================
               this.x = _stageW - _trackThickness;
               _track.height = _stageH;
               _track.y = 0;
               _tH = _track.height;
               _cH = _content.height + _defaultPosition;
               // Set height of grabber relative to how much content
               _grabber.getChildByName("bg").height = Math.ceil((_tH / _cH) * _tH);
               // Set minimum size for grabber
               if(_grabber.getChildByName("bg").height < 35) _grabber.getChildByName("bg").height = 35;
               if(_hasShine) _grabber.getChildByName("shine").height = _grabber.getChildByName("bg").height;
               // If scroller is taller than stage height, set its y position to the very bottom
               if ((_grabber.y + _grabber.getChildByName("bg").height) > _tH) _grabber.y = _tH - _grabber.getChildByName("bg").height;
               // If content height is less than stage height, set the scroller y position to 0, otherwise keep it the same
               _grabber.y = (_cH < _tH) ? 0 : _grabber.y;
               // If content height is greater than the stage height, show it, otherwise hide it
               this.visible = (_cH + 8 > _tH);
               // Distance left to scroll
               _scrollValue = _tH - _grabber.getChildByName("bg").height;
               _content.y = Math.round(-((_cH - _tH) * (_grabber.y / _scrollValue)) + _defaultPosition);
               positionGrips();
               if(_content.height < stage.stageHeight) { stage.removeEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelListener); } else { stage.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelListener); }
          //============================================================================================================================
          private function positionGrips():void
          //============================================================================================================================
               _grabberGrip.y = Math.ceil(_grabber.getChildByName("bg").y + (_grabber.getChildByName("bg").height / 2) - (_grabberGrip.height / 2));
               _grabberArrow1.y = _grabber.getChildByName("bg").y + 8;
               _grabberArrow2.y = _grabber.getChildByName("bg").height - 8;
          //============================================================================================================================
          // CREATORS
          //============================================================================================================================
          //============================================================================================================================
          private function createTrack():void
          //============================================================================================================================
               _track = new Sprite();
               var t:Sprite = new Sprite();
               t.graphics.beginFill(_trackColor);
               t.graphics.drawRect(0, 0, _trackThickness, _trackThickness);
               t.graphics.endFill();
               _track.addChild(t);
               addChild(_track);
          //============================================================================================================================
          private function createGrabber():void
          //============================================================================================================================
               _grabber = new Sprite();
               var t:Sprite = new Sprite();
               t.graphics.beginFill(_grabberColor);
               t.graphics.drawRect(0, 0, _grabberThickness, _grabberThickness);
               t.graphics.endFill();
               t.name = "bg";
               _grabber.addChild(t);
               if(_hasShine)
                    var shine:Sprite = new Sprite();
                    var sg:Graphics = shine.graphics;
                    sg.beginFill(0xffffff, 0.15);
                    sg.drawRect(0, 0, Math.ceil(_trackThickness/2), _trackThickness);
                    sg.endFill();
                    shine.x = Math.floor(_trackThickness/2);
                    shine.name = "shine";
                    _grabber.addChild(shine);
               addChild(_grabber);
          //============================================================================================================================
          private function createGrips():void
          //============================================================================================================================
               _grabberGrip = createGrabberGrip();
               _grabber.addChild(_grabberGrip);
               _grabberArrow1 = createPixelArrow();
               _grabber.addChild(_grabberArrow1);
               _grabberArrow2 = createPixelArrow();
               _grabber.addChild(_grabberArrow2);
               _grabberArrow1.rotation = -90;
               _grabberArrow1.x = ((_grabberThickness - 7) / 2) + 1;
               _grabberArrow2.rotation = 90;
               _grabberArrow2.x = ((_grabberThickness - 7) / 2) + 6;
          //============================================================================================================================
          private function createGrabberGrip():Sprite
          //============================================================================================================================
               var w:int = 7;
               var xp:int = (_grabberThickness - w) / 2;
               var t:Sprite = new Sprite();
               t.graphics.beginFill(_gripColor, 1);
               t.graphics.drawRect(xp, 0, w, 1);
               t.graphics.drawRect(xp, 0 + 2, w, 1);
               t.graphics.drawRect(xp, 0 + 4, w, 1);
               t.graphics.drawRect(xp, 0 + 6, w, 1);
               t.graphics.drawRect(xp, 0 + 8, w, 1);
               t.graphics.endFill();
               return t;
          //============================================================================================================================
          private function createPixelArrow():Sprite
          //============================================================================================================================
               var t:Sprite = new Sprite();               
               t.graphics.beginFill(_gripColor, 1);
               t.graphics.drawRect(0, 0, 1, 1);
               t.graphics.drawRect(1, 1, 1, 1);
               t.graphics.drawRect(2, 2, 1, 1);
               t.graphics.drawRect(1, 3, 1, 1);
               t.graphics.drawRect(0, 4, 1, 1);
               t.graphics.endFill();
               return t;
          //============================================================================================================================
          // LISTENERS
          //============================================================================================================================
          //============================================================================================================================
          private function mouseWheelListener(me:MouseEvent):void
          //============================================================================================================================
               var d:Number = me.delta;
               if (d > 0)
                    if ((_grabber.y - (d * 4)) >= 0)
                         _grabber.y -= d * 4;
                    else
                         _grabber.y = 0;
                    if (!_grabber.willTrigger(Event.ENTER_FRAME)) _grabber.addEventListener(Event.ENTER_FRAME, scrollContent);
               else
                    if (((_grabber.y + _grabber.height) + (Math.abs(d) * 4)) <= stage.stageHeight)
                         _grabber.y += Math.abs(d) * 4;
                    else
                         _grabber.y = stage.stageHeight - _grabber.height;
                    if (!_grabber.willTrigger(Event.ENTER_FRAME)) _grabber.addEventListener(Event.ENTER_FRAME, scrollContent);
          //============================================================================================================================
          private function onDownListener(e:MouseEvent):void
          //============================================================================================================================
               _pressed = true;
               _grabber.startDrag(false, new Rectangle(0, 0, 0, _stageH - _grabber.getChildByName("bg").height));
               stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveListener, false, 0, true);
               TweenFilterLite.to(_grabber.getChildByName("bg"), 0.5, { tint:_grabberPressColor } );
          //============================================================================================================================
          private function onUpListener(e:MouseEvent = null):void
          //============================================================================================================================
               if (_pressed)
                    _pressed = false;
                    _grabber.stopDrag();
                    stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveListener);
                    TweenFilterLite.to(_grabber.getChildByName("bg"), 0.5, { tint:null } );
          //============================================================================================================================
          private function onMouseMoveListener(e:MouseEvent):void
          //============================================================================================================================
               e.updateAfterEvent();
               if (!_grabber.willTrigger(Event.ENTER_FRAME)) _grabber.addEventListener(Event.ENTER_FRAME, scrollContent, false, 0, true);
          //============================================================================================================================
          private function onTrackClick(e:MouseEvent):void
          //============================================================================================================================
               var p:int;
               var s:int = 150;
               p = Math.ceil(e.stageY);
               if(p < _grabber.y)
                    if(_grabber.y < _grabber.height)
                         TweenFilterLite.to(_grabber, 0.5, {y:0, onComplete:reset, overwrite:1});
                    else
                         TweenFilterLite.to(_grabber, 0.5, {y:"-150", onComplete:reset});
                    if(_grabber.y < 0) _grabber.y = 0;
               else
                    if((_grabber.y + _grabber.height) > (_stageH - _grabber.height))
                         TweenFilterLite.to(_grabber, 0.5, {y:_stageH - _grabber.height, onComplete:reset, overwrite:1});
                    else
                         TweenFilterLite.to(_grabber, 0.5, {y:"150", onComplete:reset});
                    if(_grabber.y + _grabber.getChildByName("bg").height > _track.height) _grabber.y = stage.stageHeight - _grabber.getChildByName("bg").height;
               function reset():void
                    if(_grabber.y < 0) _grabber.y = 0;
                    if(_grabber.y + _grabber.getChildByName("bg").height > _track.height) _grabber.y = stage.stageHeight - _grabber.getChildByName("bg").height;
               _grabber.addEventListener(Event.ENTER_FRAME, scrollContent, false, 0, true);
          //============================================================================================================================
          private function onAddedToStage(e:Event):void
          //============================================================================================================================
               stage.addEventListener(Event.MOUSE_LEAVE, stopScroll);
               stage.addEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelListener);
               stage.addEventListener(Event.RESIZE, onStageResize, false, 0, true);
               stage.addEventListener(MouseEvent.MOUSE_UP, onUpListener, false, 0, true);
               _grabber.addEventListener(MouseEvent.MOUSE_DOWN, onDownListener, false, 0, true);
               _grabber.buttonMode = true;
               _track.addEventListener(MouseEvent.CLICK, onTrackClick, false, 0, true);
               removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
               _stageW = stage.stageWidth;
               _stageH = stage.stageHeight;
               adjustSize();
          //============================================================================================================================
          private function onStageResize(e:Event):void
          //============================================================================================================================
               _stageW = stage.stageWidth;
               _stageH = stage.stageHeight;
               adjustSize();

Similar Messages

  • When I'm in a Firefox browser window the screen info rolls up and down and doesn't respond to scroll bar control.

    This problem occurs intermmitently, but becomes more prevalent the longer I stay in the window and resumes when I move into another website. Occasionally, I seem to be able to stop the rolling by right-clicking the mouse while hovering the pointer arrow over the scroll bar. ost of the time I can not control the window roll, even with the scroll bar. If I exit Firefox and return, the problem ceases and then resues as before.

    Must be a problem with the graphics drivers or operating system.. Any other system malfunctioning reported ?
    If yes, kindly contact your system admin and format your OS...
    Must be a problem with compatibility, so please do the the above
    Happy browsing

  • Double Scroll Bars, Side By Side, End To End, In A JScrollPane

    I'm trying to create double scroll bars next to each other, end to end. One scroll bar is for the position in the grid, while the other, smaller scroll bar controls the zoom level. I am masquerading a JPanel as a JScrollBar. I'm adding two scroll bars to the panel, and encapsulating the panel in a subclass of JScrollBar. You might wonder why I would do that. Because JScrollPane only accepts JScrollBar classes in setHorizontalScrollBar() and setVerticalScrollBar(). I tried to override every painting method I could think of that was important, but when I test it, nothing is shown. It is completely blank. Here is the code below. I know I still have to override the general JScrollBar methods and pass them to the primary scrollbar. Does anyone have any ideas on how to do somethink like I am attempting to do?
    import java.awt.*;
    import javax.swing.*;
    import java.lang.reflect.*;
    * <p>Title: </p>
    * <p>Description: This class masquerades as a JScrollBar, but it wraps two scrollbars next to each other. The
    * main scrollbar, and the secondary scrollbar which is smaller. Any calls which treat this as a regular scrollbar
    * will return the main scrollbar's values, while the special methods can be used to return the seondary scrollbar's
    * values.
    * </p>
    * <p>Copyright: Copyright (c) 2003</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class DoubleScrollBar extends JScrollBar {
      JPanel panel = new JPanel();
      JScrollBar primary;
      JScrollBar secondary;
      public DoubleScrollBar(int orientation) {
        init(orientation);
      void init() {
        panel.setLayout(new GridBagLayout());
        if ( orientation == JScrollBar.HORIZONTAL ) {
          primary = new JScrollBar(JScrollBar.HORIZONTAL);
          secondary = new JScrollBar(JScrollBar.HORIZONTAL);
          GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 0.75, 0.0,
              GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0);
          panel.add(primary, gbc);
          gbc.gridx = 1;
          gbc.weightx = 0.25;
          gbc.anchor = GridBagConstraints.EAST;
          panel.add(secondary, gbc);
        } else if ( orientation == JScrollBar.VERTICAL ) {
          primary = new JScrollBar(JScrollBar.VERTICAL);
          secondary = new JScrollBar(JScrollBar.VERTICAL);
          GridBagConstraints gbc = new GridBagConstraints(0, 0, 1, 1, 0.0, 0.75,
              GridBagConstraints.NORTH, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0);
          panel.add(primary, gbc);
          gbc.gridy = 1;
          gbc.weighty = 0.25;
          gbc.anchor = GridBagConstraints.SOUTH;
          panel.add(secondary, gbc);
      public Dimension getPreferredSize() {
        return panel.getPreferredSize();
      public void setPreferredSize(Dimension d) {
        panel.setPreferredSize(d);
      public Dimension getSize() {
        return panel.getSize();
      public void paint(Graphics g) {
        panel.paint(g);
      public void paintAll(Graphics g) {
        panel.paintAll(g);
      protected void paintComponent(Graphics g) {
        try {
          Method m = panel.getClass().getMethod("paintComponent", new Class[] {Graphics.class});
          m.invoke(panel, new Object[] {g});
        catch (SecurityException ex) {
          System.out.println("SecurityException");
        catch (NoSuchMethodException ex) {
          System.out.println("NoSuchMethodException");
        catch (InvocationTargetException ex1) {
          System.out.println("InvocationTargetException");
        catch (IllegalArgumentException ex1) {
          System.out.println("IllegalArgumentException");
        catch (IllegalAccessException ex1) {
          System.out.println("IllegalAccessException");
      public void paintComponents(Graphics g) {
        panel.paintComponents(g);
      public void repaint(long tm, int x, int y, int w, int h) {
        if ( panel != null ) {
          panel.repaint(tm, x, y, w, h);
      public int getWidth() {
        return panel.getWidth();
      public int getHeight() {
        return panel.getHeight();
      public static void main(String[] args) {
        JFrame f = new JFrame();
        DoubleScrollBar dsb = new DoubleScrollBar(JScrollBar.HORIZONTAL);
        dsb.setPreferredSize(new Dimension(200, 50));
        f.getContentPane().add(dsb);
        f.pack();
        f.show();

    I know this isn't zooming, but maybe it will help.import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test3 extends JFrame {
      MyPanel mp = new MyPanel();
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        JScrollBar jsb = new JScrollBar();
        jsb.addAdjustmentListener(new AdjustmentListener() {
          public void adjustmentValueChanged(AdjustmentEvent ae) {
            mp.setSize(ae.getValue()*5);
        content.add(jsb, BorderLayout.EAST);
        mp.setPreferredSize(new Dimension(500,500));
        content.add(new JScrollPane(mp), BorderLayout.CENTER);
        setSize(300, 300);
      public static void main(String[] args) { new Test3().setVisible(true); }
    class MyPanel extends JPanel {
      int size;
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.setColor(Color.red);
        g.drawRect(10,10,size,size);
      public void setSize(int size) {
        this.size=size;
        repaint();
    }

  • How to get transparency scroll bar to view background image of canvas.

    HI, 
    How to get transparency to path in canvas to view background image in canvas using scroll bar control.?
    This is my present output:
    My Xaml Code:
    <Grid Height="auto" Name="grid1">
    <TabControl Background="Bisque">
    <TabItem Header="Tools">
    <Grid Height="1000" Width="1000" Name="grid">
    <Border BorderThickness="0.2" BorderBrush="Black" Height="820" Width="820" ClipToBounds="True" Margin="90,99,90,81"></Border>
    <Grid>
    <Button Content="Original Size" Height="23" Name="btn_Original" Width="75" Click="btnOriginalSizePosition" Margin="4,4,921,973" />
    <TextBox Height="20" HorizontalAlignment="Left" Margin="62,49,0,0" x:Name="txtNoOfZones" VerticalAlignment="Top" Width="49"
    MaxLength="2" PreviewTextInput="txtNoOfZones_PreviewTextInput"/>
    <TextBox Height="20" HorizontalAlignment="Right" Margin="0,71,890,0" x:Name="txtSec" VerticalAlignment="Top" Width="49" PreviewTextInput="txtSec_PreviewTextInput" MaxLength="3"/>
    <Button Content="OK" Height="32" HorizontalAlignment="Left" Margin="117,59,0,0" Name="btnNoOfZones" VerticalAlignment="Top" Width="39" Click="btnNoOfZones_Click" />
    <Label Content="Zone Number selected :" Height="28" HorizontalAlignment="Right" Margin="0,0,451,0" Name="lblZone" VerticalAlignment="Top" />
    <Label Content="Sector Number in selected Zone :" Height="28" HorizontalAlignment="Right" Margin="364,22,451,0" Name="lblSector" VerticalAlignment="Top" />
    <Label Content="Filled Color applied in selected sector :" Height="28" HorizontalAlignment="Right" Margin="336,44,451,0" Name="lblColor" VerticalAlignment="Top" />
    <Label HorizontalAlignment="Left" Margin="569,0,0,0" Name="lblZoneNumber" Height="28" VerticalAlignment="Top" />
    <Label Height="28" HorizontalAlignment="Left" Margin="569,22,0,0" Name="lblSectorNumber" VerticalAlignment="Top" />
    <Label Height="30" HorizontalAlignment="Left" Margin="569,44,0,0" Name="lblFillColor" VerticalAlignment="Top" FontWeight="Bold"/>
    <Label Content="Sectors :" Height="28" HorizontalAlignment="Left" Margin="7,67,0,905" Width="69" />
    <Label Content="Zones :" HorizontalAlignment="Left" Margin="13,44,0,928"/>
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="4,32,0,0" Text="Change No.of Zones, sectors below and click OK button" VerticalAlignment="Top" Width="294" FontFamily="Cambria" FontSize="12" FontStyle="Italic" FontWeight="Bold" />
    <RadioButton Content="Single Sector" Height="16" HorizontalAlignment="Left" Margin="744,24,0,0" Name="rBtnSingleSector" VerticalAlignment="Top" GroupName="Selection"/>
    <RadioButton Content="Sector Zone" Height="16" HorizontalAlignment="Left" Margin="744,44,0,0" Name="rBtnSectorZone" VerticalAlignment="Top" GroupName="Selection"/>
    <RadioButton Content="Circular Zone" Height="16" HorizontalAlignment="Left" Margin="744,64,0,0" Name="rBtnCircularZone" VerticalAlignment="Top" GroupName="Selection"/>
    <RadioButton Content="Panning" Height="24" HorizontalAlignment="Left" Margin="744,4,0,0" Name="rBtnPanning" VerticalAlignment="Top" Width="74" GroupName="Selection"/>
    <Border x:Name="clipBorder" BorderBrush="Black" BorderThickness="0" ClipToBounds="True" Height="810" Width="810" Margin="95,104,95,86" CornerRadius="10">
    <Canvas x:Name="CanvasPanel" Height="800" Width="800" Background="Transparent" ClipToBounds="True"></Canvas>
    </Border>
    <RadioButton Content="Random Color" HorizontalAlignment="Left" Margin="868,5,0,979" Name="rdBtnRandomColor" GroupName="rdbtnGroupFillColor"/>
    <RadioButton Content="Red Color" Height="16" HorizontalAlignment="Left" Margin="868,24,0,0" Name="rdBtnRedColor" VerticalAlignment="Top" GroupName="rdbtnGroupFillColor" Foreground="#FFF81010" FontWeight="Bold" />
    <RadioButton Content="Green Color" Height="16" HorizontalAlignment="Left" Margin="868,44,0,0" Name="rdBtnGreenColor" VerticalAlignment="Top" GroupName="rdbtnGroupFillColor" Foreground="#FF175F17" FontWeight="Bold" />
    <RadioButton Content="Adjacent" Height="16" HorizontalAlignment="Left" Margin="435,81,0,0" Name="rdBtnAdjacent" VerticalAlignment="Top" GroupName="Selection" />
    </Grid>
    </Grid>
    </TabItem>
    <TabItem Header="Change Background">
    <Grid Height="1000" VerticalAlignment="Top" Background="Bisque">
    <Button Height="70" Width="70" Margin="6,1,892,929" Name="btnBrowseImage" Click="btnAll">
    <Image x:Name="browseIcon" Source="D:\WPF\Projects\TabControlVRI_18_12_2014\Images\img.png" MouseLeftButtonDown="Image_MouseLeftButtonDown_1"/>
    </Button>
    <Button Height="70" Width="70" Margin="92,1,806,929" Name="btnCenterPoint" Click="btnAll">
    <Image x:Name="centerIcon" Source="D:\WPF\Projects\TabControlVRI_18_12_2014\Images\center.jpg" Width="54" Height="48" />
    </Button>
    <Button Height="70" Width="70" Margin="179,1,719,929" Click="btnAll">
    <Image x:Name="boundaryIcon" Source="D:\WPF\Projects\TabControlVRI_18_12_2014\Images\Path_Simple.png" Height="44" Width="49" />
    </Button>
    <Image Name="imgBackground" Height="800" Width="800" MouseLeftButtonDown="imgBackground_MouseLeftButtonDown">
    </Image>
    </Grid>
    </TabItem>
    </TabControl>
    </Grid>
    C# code:
    OpenFileDialog op = new OpenFileDialog();
    ImageBrush ib = new ImageBrush();
    private void Image_MouseLeftButtonDown_1(object sender, RoutedEventArgs e)
    op.Title = "Select a picture";
    op.Filter = "All supported graphics|*.jpg;*.jpeg;*.png|" +
    "JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" +
    "Portable Network Graphic (*.png)|*.png";
    if (op.ShowDialog() == true)
    ib.ImageSource = new BitmapImage(new Uri(op.FileName));
    imgBackground.Source = new BitmapImage(new Uri(op.FileName));
    CanvasPanel.Background = ib;
    Please help me out to get transparency for path in canvas to view background image in canvas.
    The complete code is in below link:
    https://onedrive.live.com/redir?resid=876CFAE94C306176!112&authkey=!AC1sQIYwyoRYT_o&ithint=file%2crar
    Regards,
    Viswa.

    Hi ViswAmmu,
    >>Please help me out to get transparency for path in canvas to view background image in canvas.
    If I'm not misunderstanding, I think you just need to loop through all Canvas.Children and set Opacity property for them:
    private void Image_MouseLeftButtonDown_1(object sender, RoutedEventArgs e)
    //Loop through all children items
    foreach(UIElement v in CanvasPanel.Children)
    v.Opacity = 0;
    op.Title = "Select a picture";
    op.Filter = "All supported graphics|*.jpg;*.jpeg;*.png|" +
    "JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" +
    "Portable Network Graphic (*.png)|*.png";
    if (op.ShowDialog() == true)
    ib.ImageSource = new BitmapImage(new Uri(op.FileName));
    imgBackground.Source = new BitmapImage(new Uri(op.FileName));
    CanvasPanel.Background = ib;
    Screenshot:
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Issue in table control scroll bar

    Hi experts,
    In Table control I used the following code,
    Refresh control 'TCDATA' from screen '200'.
    If i use this code i cant able to  scroll the data when the table control having multiple lines.
    Can any one suggest me?. what i need to do for this..
    Edited by: sai.bala on Sep 17, 2010 12:22 PM

    Hi ,
    try this...
    Refresh control 'TCDATA' from screen '200'.
    "write this statement below refresh table control
    * Describe lines of internal table to extend the table control Vertical
    * scroll bar
      DESCRIBE TABLE <tablename> LINES TCDATA-lines.
    prabhudas

  • Scroll Bar Problem after Printing a web page containing multiple page data

    Hi All,
    I have a web application which has two DIV, one is main and one is child. I am having problem in printing multiple pages. There is a lot of data in the child DIV and i am using JavaScript functions to control the print functionality. When i print using window.print(), only the data on the main page currently being showed is printed. I further researched and checked out the Style.Overflow property.
    Now i am using divMain.style.overflow = "visible"
    After this the complete print comes. But in Firefox, the scroll bar disappears and only single page is left with no scroll bar .
    Now if after print i give divMain.style.overflow = "Auto" OR divMain.style.overflow = "Scroll", still the scroll bar doesn't come and if it comes then its inactive. I am unable to see the complete data on the page after the print is taken.
    The problem is not coming in I.E and the full data with scroll bar is recovered in I.E.
    Please help me how to get the normal page with full data and scroll bar after printing in Firefox.
    Thanks,
    Manuj

    hi, i would update my reader first to the newest version.
    does the size of the textfield never change, independant how much text is in it?
    perhaps check your subforms, if they are type "position" size does not change in my opinion, except your parent subforms expand to fit....
    or use "flowed" subforms...and regard the parent subforms too!

  • Image control synchronizing scroll bars

    Hello, I have a LabVIEW program using Vision that I want to use multiple Image controls in a VI.  I would like to be able to synchronize the movements of the scroll bars.  If a user scrolls left in one window, I want the other window(s) to also scroll left the same amount.  Is this possible?  I know it can be done with 2D picture controls but I would like to do this with a Image control (not external).  It would also be helpful to zoom synchronously.
    Thank you.
    Solved!
    Go to Solution.

    -I think we can enable/disable the scrollbars through property nodes. Let's see if anyone else has idea on programmatically moving scrollbars for image control.
    -For zoom you can use zoom property node of selected image control and write the same to other image controls.
    Thanks
    uday,
    Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
    Certified LabVIEW Associate Developer (CLAD) Using LV13

  • How to activate the Vertival Scroll Bar to Table control

    Hi All,
    I Have created a Module pool table control(Wizard) with Input control,where user can enter the values in the screen.
    In my screen 15 lines are visible,once i enter all 15 rows,vertical scroll bar is active,but rest of all lines are in deactivate mode.
    My requirement is:Once i enter all the visible lines,the remaining lines should be in activ mode(In put control).
    I appreciate your response.
    Best Regards,
    Seshadri

    DATA : BEGIN OF IT_MARA OCCURS 1,
           MATNR LIKE MARA-MATNR,
           ERSDA LIKE MARA-ERSDA,
           ERNAM LIKE MARA-ERNAM,
           MTART LIKE MARA-MTART,
           MBRSH LIKE MARA-MBRSH,
           V_FLAG TYPE C,
           END OF IT_MARA.
    DATA :  WA_MARA LIKE it_MARA .
    CONTROLS TABLE TYPE TABLEVIEW USING SCREEN 100.
    MODULE POPULATE_100 INPUT.
      CASE SY-UCOMM.
        WHEN 'DISP'.
          SELECT MATNR
                 ERSDA
                 ERNAM
                 MTART
                 MBRSH FROM MARA INTO WA_MARA .
            APPEND WA_MARA TO IT_MARA.
          ENDSELECT.
          DESCRIBE TABLE IT_MARA LINES V_TEXT.
          TABLE-LINES = V_TEXT.
          CLEAR IT_MARA.
    Regards..
    Balaji  ( assign if this helps u ..)

  • How do i control 2 text boxes with 1 scroll bar? (CS4)

    I want to control 2 Dynamic Text boxs with the 1 scroll bar component? I want them to scroll simultaneously with the user only needing to use the one component. Thank you in advance for your help

    The textfields should have the same number of lines.  You can have the scrollbar (sb) assigned to one textfield (t1) and then have an event listener/handler for the scrollbar adjust the other textfield's (t2) scrollV property to match the first one's scrollV property:
    import fl.events.ScrollEvent;
    sb.addEventListener(ScrollEvent.SCROLL, adjustTs);
    function adjustTs(evt:ScrollEvent):void {
        t2.scrollV = t1.scrollV;

  • Scroll Bars in Table Control

    Hi,
    How do I remove the vertical and horizontal scroll bars in the table control? I would like to use the Pg Up/Down buttons instead.
    Thanks,
    Mounika.

    Mounika,
    You can add or remove the scroll bar in the table control by switching off horizontal and vertical scrolling in the properties of the table control. The properties can be accessed from the screen painter by double clicking on the table control. Regarding the page up and page down functions, I believe you add those buttons in the screen layout and code for them. You can use the standard function code for the page up and page down functions.
    Regarding the Page up Page down...You need to add some extra code in your program to activvate that. Check the following program for example.
    DEMO_DYNPRO_TABCONT_LOOP_AT
    or try something like this
    try something like:
    CASE sy-ucomm.
    WHEN 'P+' OR
    'P++' OR
    'P-' OR
    'P--'
    CALL FUNCTION 'SCROLLING_IN_TABLE'
    EXPORTING
    entry_act = tc-top_line
    entry_to = tc-lines
    last_page_full = 'X'
    loops = loops
    ok_code = sy-ucomm
    overlapping = 'X'
    IMPORTING
    entry_new = tc-top_line
    EXCEPTIONS
    no_entry_or_page_act = 1
    no_entry_to = 2
    no_ok_code_or_page_go = 3
    OTHERS = 4
    ENDCASE   .
    Hope this helps
    Vinodh Balakrishnan

  • Remove vertical scroll bar from table control

    hi,
    i had used table control in my application. i want remove vertical scroll bar from table control.
    At initial time in table control there is no vertical scroll bar. In my table control lines are dependent on internal table which i was used to fill it.
    i was used these code for to set table control lines.
    DESCRIBE TABLE IT_RISK_ZINRISEXC LINES EXC_LINE.
    TC_RISK_EX-LINES =   EXC_LINE .
    Initially there is no data in internal table so there is no vertical scroll bar. After getting value i am filling internal table. and there is scroll bar in my table control. but i does not want that.
    i was not selected RESIZING-VERTICAL OR -HORIZONTAL.

    Hi,
    From Scroll Bars in Table Control
    You can remove the scroll bar in the table control by switching off horizontal and vertical scrolling in the properties of the table control. The properties can be accessed from the screen painter by double clicking on the table control. Regarding the page up and page down functions, I believe you add those buttons in the screen layout and code for them. You can use the standard function code for the page up and page down functions.
    or
    You can get rid of the vertical scroll bars by not setting table control lines. This way the user can only see the visible lines of the table control. As for the horizontal scrollbar, just make sure that your table control doesn't contain too many fields.
    Regards,
    Raj.

  • How to Enable to vertical scroll bar in a table control

    Hi,
    I have created a table control with a wizard and later did some modifications on it. Problem I have now is that the vertical scroll bar is disabled on this table control. The end user wants to enter as many rows as possible, however as the scroll bar is disabled, he is not able to add the rows at the end (of the visible table control area).
    How do I enable the vertical scroll bar of the table control?
    Please help.
    Thanks,
    Vishal.

    Hello Vishal,
    In PBO.
    Create a Module and in the module increment the value of tbcl-lines.
    ex:
    Data : L type i.
    IN PBO.
    MODULE vertical_scroll_bar.
    MODULE vertical_scroll_bar.
    DESCRIBE TABLE itab lines L.
    <table control name>-lines = L + 10.
    ENDMODULE.
    Hope this solves your issue.
    Cheers,
    Suvendu

  • Vertical scroll bar in table control with wizrads

    Hi,
      Im working on a table control with a customised table. I created a table control with wizards. But vertical scroll bar is not working. How can i invoke vertical scroll bar and can any one provide the code for the all the operations on a table control like save,find,find next,change....Thanks in advance.
    Avinash

    Hi Avinash
    move the records number of your internal table into field LINES of tablecontrol. So you should change the code generated by wizard in PBO, for example create a new module:
    PROCESS PBO
    MODULE SET_DATA_TO_T_CTRL.
    LOOP..
    ENDLOOP.
    MODULE SET_DATA_TO_T_CTRL.
       DESCRIBE TABLE ITAB LINE SY-TABIX.
       <TABLECONTROL>-LINES = SY-TABIX.
    ENDMODULE.
    Max

  • Table Control Scroll Bar inactive

    Hi All,
    I am facing a strange problem. I have placed a table control on my screen and have added the columns. Rest of the functionality is also fine. However, even when the number of rows in the table exceeds its height, the Vertical Scroll bar is inactive and I cannot scroll down to the hidden line items. The horizontal scroll bar is working perfectly.The color of the Vertical Scroll bar is also Dark grey (as in inactive.)
    I fail to understand what could be the reason for this? Helpful answers will be suitably rewarded
    Regards,
    Madhur

    Hi Madur,
    Try this code :
    (assume that the name of your table control is T1)
    In the screen logic you will have:
                    Loop with control T1.
                       module get_Looplines.
                    Endloop.
                        Module get_looplines.
                          Looplines = sy-loopc.
                        Endmodule.
    In the PBO of the screen you will have a module that loads the itab and determines the total number of lines read.
                   Module load_itab.
                    .      (select database table and
    append to itab)
                    describe table itab lines linecount.
                   Endmodule.
    We now have all the values to construct a scroll module.
    MODULE SCROLL INPUT.
    CASE SAVE_OK_CODE.
    WHEN 'P--'.
       T1-TOP_LINE = 1.
    WHEN 'P-'.
       T1-TOP_LINE = T1-TOP_LINE - LOOPLINES.
         IF T1-TOP_LINE < 1.
            T1-TOP_LINE = 1.
         ENDIF.
    WHEN 'P+'.
       T1-TOP_LINE = T1-TOP_LINE + LOOPLINES.
         IF T1-TOP_LINE > LINECOUNT.
            T1-TOP_LINE = LINECOUNT - LOOPLINES + 1.
         ENDIF.
    WHEN 'P++'.
       T1-TOP_LINE = LINECOUNT - LOOPLINES + 1.
    ENDCASE.
    ENDMODULE.                 " SCROLL  INPUT
        WHEN 'P--'.
          CLEAR SY-UCOMM.
          CTR1-TOP_LINE = 1.
        WHEN 'P-'.
          CLEAR SY-UCOMM.
          CTR1-TOP_LINE = CTR1-TOP_LINE - LINECOUNT1.
          IF CTR1-TOP_LINE < 1.
            CTR1-TOP_LINE = 1.
          ENDIF.
        WHEN 'P+'.
          DESCRIBE TABLE ITAB1 LINES N1.
          CTR1-TOP_LINE = CTR1-TOP_LINE + LINECOUNT1.
          IF CTR1-TOP_LINE > N1.
            CTR1-TOP_LINE = N1.
          ENDIF.
          CLEAR SY-UCOMM.
        WHEN 'P++'.
          DESCRIBE TABLE ITAB1 LINES N1.
          CLEAR SY-UCOMM.
          CTR1-TOP_LINE = N1.
    Cheers
    Sunny
    Rewrd points, if helpful

  • Table control scroll bar issue

    how to set the scroll bar for table control for the transaction code va42 for billing plan tab.
    i have added few custom fileds for the table control, when i m re-arranging the columns for the table control, the scroll bar is fixed for one field( as standard) and the scroll bar starts from that place. how to fix the scroll bar or control the scroll bar and sets it position for the desired column.

    HI,
    Table control ahs a property called FIXED_COLS. You ave to pass the column number to this property.

Maybe you are looking for