Flash effect in Toggle Buttons

Hi all:
I try to make an animated effect as in the ToggleButtons event "onMouseEntered"
My idea is that the shadow of the buttons make a blink effect. While the pointer is over the button, I want the shadow becomes large and then small, then big and then small ...
I tried doing some testing with this code:
@FXML private Label label;
    @FXML private ToggleButton boton1;
    @FXML private ToggleButton boton2;
FadeTransition ft = new FadeTransition(Duration.millis(3000), boton1);
DropShadow ds = new DropShadow();
Timeline timeLine;
public void shadowTButtons(MouseEvent evt){
    ds.setColor(Color.web("#13EC0C"));
    ds.setRadius(0.1);
    ds.setSpread(0.6f);
    ds.setOffsetX(0.0f);
    ds.setOffsetY(0.0f);
    timeLine= new Timeline();
    timeLine.setCycleCount(Timeline.INDEFINITE);
    timeLine.setAutoReverse(true);
    KeyValue keyvalue1 =  new KeyValue(ds.radiusProperty(), 2, Interpolator.EASE_OUT);
    ds.setRadius(20.0);
    KeyValue keyvalue2 =  new KeyValue(ds.radiusProperty(), 2, Interpolator.EASE_OUT);
    Duration duration = Duration.millis(10000);
    KeyFrame keyframe1 = new KeyFrame(Duration.seconds(0), keyvalue1);
    KeyFrame keyframe2 = new KeyFrame(duration, keyvalue2);
     timeLine.getKeyFrames().add(keyframe1);
     timeLine.getKeyFrames().add(keyframe2);
     timeLine.play();
     boton2.setEffect(ds);
}I'm not saying that the code is consistent. Just say I tried.
The program "runs" but does absolutely nothing.
I would appreciate any help. It's my first foray into animation programming and I'm still pretty new to JavaFX.
Sorry if English is not very good.
blessings
Edited by: biochemistry43 on 17/12/2012 01:40 PM

It looks like the end values for both your KeyValues are equal to 2; I think this means the animation would actually change anything. Try setting the first to 20:
KeyValue keyvalue1 =  new KeyValue(ds.radiusProperty(), 20, Interpolator.EASE_OUT);I assume you are setting the drop shadow on the appropriate toggle button somewhere? Something like boton1.setEffect(ds)...?

Similar Messages

  • Integrated scroll panels and unmovable toggle buttons

    Hey,
    iam looking for an expert. I am working on an HMI development and wanted to use Flash Catalyst. However, I think I am already reached the limits of FC. But perhaps there is a FC solution because I can not program Flash.
    Problem:
    In my layer, I have different graphical objects and text blocks. A part of them I want to move with a scroll panel. That's easy, not a problem.
    However, all these objects (including the scroll panels) should be integrated in a master scroll panel. This means, that all parts, even the integrated scroll panels, should be moveable at the same time. I managed this.
    Now, I need multiple toggle buttons. With these Buttons I wanted to change the form of some of the graphical objects resp. the text blocks. But the buttons have to be unmovable. This function (to change the form of the objects) is relatively easy but in combination with the integrated scroll panels it isnt. The buttons are able to move the objects when these buttons are pasted in the "deepest" layer, the layer of the objects. But there, the buttons are moveable and slide out of the screen (with the master scroll panel) and not clickable.
    How can I manage this? I need unmovable toggle buttons, with these I want to change the forms of objects. The objects are pasted in integrated scroll panels. I hope it's understandable!
    Can someone help me? It would be glad if the answer does not depend on the learning of the flash programming!
    Thanks.

    After 2 days of banging my head against a wall (doesn't it always go that way)...
    Turns out one of my panels had sub-panels causing the problem. Visibility to the parent panel was controlled by a button on one of the child panels. Once I "promoted" the button to the parent panel, the panel (screen) flow worked great.
    Is this 'undocumented functionality'? Why should it matter how deep the button is nested? (incidentally, the reason it worked in my test environment was the lack of other components - aka the child panel)
    Well, regardless. Thanks to those who gave it thought.

  • Play pause toggle button

    Hi,
    I'm new to Flash. Kindly help anyone.
    Need assistance to create toggle button. Here attaced two screenshots.
    1. inner-animation.jpg - it contains all movie clips and play pasue controls.
    2.main-animation.jpg - this is the main timeline ( inside all movie clips & control buttons)
    3.playbuton-inside.jpg - its a button symbol ( as well as pause )
    4. There also bg music and sounds for some particular animation.
    Here all working fine. But i need play & pause animation as a toggle button.
    Here is the code i added for pause:
    play();
    pause_btn.onRelease=function(){
    stop();
    Here is the code i added for pause:
    stop();
    play_btn.onRelease=function (){
    play();

    You are using AS2 code, so you should be posting in the AS2 forum (http://forums.adobe.com/community/flash/flash_actionscript?view=discussions).  If the intention is to use AS3 code, then you need to change things.
    If the intention is to use the same single button for both pause and play, then what you normally would do is establish a boolean variable that you se to determine whether the clicking of the button should play or stop the movie...
    var playMovie:Boolean = true; // assumes the movie is stopped at the start
    pause_play_btn.onRelease = function (){
       if(playMovie){
           play();
           // manage play/pause btn
       } else {
           stop();
           // manage play/pause btn
       playMovie = !playMovie; // reverse the value of the playMovie variable
    In that code where I show "// manage play/pause btn" is where you need to do whatever you need to make the pause/play button appear as intended... either hiding one or the other, or changing its frames to show the appropriate image.

  • Question concerning Selecting and Deselecting Toggle Buttons

    Hello Everyone,
    I am still relatively new to the adobe web suite (still in the trial period in fact). I am working on creating a mock-up of a main web page design to demonstrate and discuss with management. The decision associated with such would determine if we go forward with purchasing adobe products, continuing a redesign of our website among many other things.
    The big issue that I am running into at the moment is creating a series of interactive thumbnails.
    I have the following set up on the page:
    - A section for the actual image (full sized) complete with a title and description provided at the side for one of potentially many topics.
    - Below the topic/image section is a series of thumbnails, which the first one is set for full opacity and marked as selected. (All of these thumbnails are in a Custom Component and break down into a Toggle Button component each, if the image is unselected it remains set at a low opacity)
    - When selecting one of the other thumbnails, I need it to change the image (this part works), select/set the thumbnail to full opacity (this part works as well, given it is a toggle button feature), and lastly unselect the previous thumbnail (causing it to go to a lower opacity, I cannot figure out a way to accomplish this one)
    - In the future I intend to design side bars (left and right) for both thumbnails and the section above (effectively changing the topic to a new one)
    The ultimate idea is to create articles, provided with thumbnails associated to the article at the bottom and to allow clean alternation between the thumbnails, and likewise be able to switch to a new article (with a new set of thumbnails associated to the new article) as well.
    Any help would be greatly appreciated.
    -Steven

    I think I found the solution of my own question. I share it in the hope that it’ll be useful to other people. Remind that I use Cp 6.1.0.319. I modified the project as follows: 1) I unchecked “Visible in output” for the button “Audio Play” (Bt_play) 2) I  modified the AA associated to the audio on/off buttons as descrived below: Action Name: Play Assign cpCmndMute with 0 Show Bt_Stop Enable Bt_Stop Hide Bt_Play Disable    Bt_Play Action Name: Stop Assign cpCmndMute with 1 Show Bt_Play  Enable Bt_Play  Hide Bt_Stop Disable Bt_Stop In this way the two buttons in the same location work well as a real toggle button! Greetings Elena

  • Set Icon for toggle button

    I created Icon with Borderpane, image and text which I want to set as button icon.
    @Override
        public void start(Stage primaryStage)
            final VBox vbox = new VBox();
            // create 3 toggle buttons and a toogle group for them
            ToggleButton tb1 = new ToggleButton();
            tb1.setGraphic(newConnectionIcon());
            ToggleButton tb2 = new ToggleButton();
            ToggleButton tb3 = new ToggleButton();
            final ToggleGroup group = new ToggleGroup();
            tb1.setToggleGroup(group);
            tb2.setToggleGroup(group);
            tb3.setToggleGroup(group);
            // select the first button to start with
            group.selectToggle(tb1);
            final Rectangle rect1 = new Rectangle(300, 300);
            rect1.setFill(Color.DARKOLIVEGREEN);
            final Rectangle rect2 = new Rectangle(300, 300);
            rect2.setFill(Color.LAVENDER);
            final Rectangle rect3 = new Rectangle(300, 300);
            rect3.setFill(Color.LIGHTSLATEGREY);
            tb1.setUserData(rect1);
            tb2.setUserData(rect2);
            tb3.setUserData(rect3);
            group.selectedToggleProperty().addListener(new ChangeListener<Toggle>()
                @Override
                public void changed(ObservableValue<? extends Toggle> ov, Toggle toggle, Toggle new_toggle)
                    if (new_toggle == null)
                    else
                        vbox.getChildren().set(1, (Node) group.getSelectedToggle().getUserData());
            HBox hBox = new HBox();
            hBox.getChildren().addAll(tb1, tb2, tb3);
            hBox.setPadding(new Insets(10, 10, 10, 10));
            vbox.getChildren().addAll(hBox, (Node) group.getSelectedToggle().getUserData());
            StackPane root = new StackPane();
            root.getChildren().add(vbox);
            Scene scene = new Scene(root, 800, 850);
            primaryStage.setScene(scene);
            primaryStage.show();
        private static BorderPane newConnectionIcon() {
            // Add background effect
            DropShadow ds = new DropShadow();
            ds.setOffsetY(2.0);
            ds.setOffsetX(2.0);
            ds.setColor(Color.GRAY);
            // New BorderPane which will hold the components
            bpi = new BorderPane();
            bpi.setEffect(ds);  // Add the effect
            bpi.setCache(true);
            // Set the size of the BorderPane
            bpi.setPrefSize(30, 30);
            bpi.setMaxSize(30, 30);
            // Add style       
            bpi.setStyle("-fx-background-color: linear-gradient(#f2f2f2, #d4d4d4);"
                    + "  -fx-background-insets: 0 0 -1 0, 0, 1, 2;"
                    + "  -fx-background-radius: 3px, 3px, 2px, 1px;");
            // Add Label to the Icon
            Text inftx = new Text("New Connection");
            inftx.setFont(Font.font ("Verdana", 5));   // Set font and font size
            inftx.setFill(Color.WHITE); // Set font color
            ncpic.setFitHeight(25);    // Set size of the Icon picture
            ncpic.setFitWidth(25);
            // Internal StackPane which will hold the picture and the Icon Label
            StackPane stack = new StackPane();
            stack.getChildren().addAll(ncpic, inftx);   // Add the picture and the Label
            // Add the StackPane to the main BorderPane       
            bpi.setCenter(stack);
            // Change the border of the Icon when the mouse is over the Icon
            bpi = mouseOver(bpi);
            // Navigate to new Panel when the user clicks on the Icon
            bpi.setOnMouseClicked(new EventHandler<MouseEvent>() {
                @Override
                public void handle(MouseEvent t) {
            return bpi;
    How I can remove the default togglebutton and use the my custom icon as a button?

    Yes, they are icons and they are called "handles". The easiest way to change then is to use UIManager.
    If you haven't done so before, look through the hash table UIManager.getLookAndFeelDefaults().
    import java.awt.*;
    import java.net.*;
    import javax.swing.*;
    public class TreeIcons {
         public static void main(String[] args) throws MalformedURLException {
              String prefix = "http://forum.java.sun.com/images/";
              UIManager.put("Tree.openIcon", new ImageIcon(new URL(prefix + "dont_save.gif")));
              UIManager.put("Tree.closedIcon", new ImageIcon(new URL(prefix + "save.gif")));
              UIManager.put("Tree.leafIcon", new ImageIcon(new URL(prefix + "forum_new.gif")));
              UIManager.put("Tree.expandedIcon", new ImageIcon(new URL(prefix + "email_faded.gif")));
              UIManager.put("Tree.collapsedIcon", new ImageIcon(new URL(prefix + "email.gif")));
              JFrame f = new JFrame("TreeIcons");
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              f.getContentPane().add(new JTree());
              f.setSize(new Dimension(300,400));
              f.setLocationRelativeTo(null);
              f.setVisible(true);
    }

  • How to create a "Pressed" effect for WPF Button?

    Hi,
    I've been searching for quite sometime but I'm not able to find a way to give a "Pressed" effect to a button when it is clicked, a la "Popup" style in C#.
    Could someone help me in this regard?
    Currently I'm using the following code for setting up a circular button.
    <Button x:Name="btnNew" Content="Delivery Note" HorizontalAlignment="Left" Margin="512,147,0,0" VerticalAlignment="Top" Width="63" Height="63" BorderThickness="0" Click="Button_Click_1"
    Cursor="Hand" Padding="1,1,1,1" UseLayoutRounding="True" >
                <Button.Effect>
                    <DropShadowEffect ShadowDepth="2" />
                </Button.Effect>
                <Button.Template>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <Ellipse Stroke="Black">
                                <Ellipse.Fill>
                                    <ImageBrush ImageSource="Images/Delivery.png">
                                    </ImageBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                        </Grid>
                    </ControlTemplate>
                </Button.Template>
            </Button>
    Thanks

    Not a popup control. 
    In Visual Studio 2008, in Button properties there is a property called "FlatStyle" in which there is an option "Popup". The button gives a click effect when an user clicks on it. Currently that button effect is not there in the Wpf button
    that I am trying to create.
    Thanks.
    This isn't explicit enough.
    In windows forms there is a popup effect on the flatstyle enumeration.
    https://msdn.microsoft.com/en-us/library/system.windows.forms.flatstyle(v=vs.110).aspx
    Is that what you mean?
    It says
    A control appears flat until the mouse pointer moves over it, at which point it appears three-dimensional.
    But that is mouse over rather than clicked,
    Could you please describe what you mean?
    You want it to look like what before it;s clicked and what after it's clicked?
    And is mouse over involved or not?
    In WPF there is something called a toggle button.
    You click and it sets IsChecked = true.
    Click again and it sets IsChecked = False.
    You could use that to drive a trigger and that trigger could do something to the look of the button.
    There is also visual states you could use.
    https://msdn.microsoft.com/en-us/library/cc296245(v=vs.95).aspx
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • How can I keep just the large fox on my homepage? The flashing message about the buttons is a little too much!!

    I was at least able to clear the new flashing message about simplifying buttons by clicking back to home or refreshing the page to get the stationary fox wrapped around the world back, now it will not do it. I have a medical condition that sometimes is aggravated when there is a flashing screen. Please help...
    Thank-you & have a nice day! :)

    If you prefer not to see snippets on the about:home page then you can set the <b>browser.aboutHomeSnippets.updateUrl</b> pref to an empty string on the <b>about:config</b> page.
    Delete the <b>storage\moz-safe-about+home</b> folder in the Firefox profile folder with Firefox closed to remove snippets stored in IndexedDB and make Firefox use a default set.
    You can use this button to go to the currently used Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    You can reset the browser.aboutHomeSnippets.updateUrl pref to the default value to re-enable the snippets.

  • Contacts Calendars Bookmarks Find My iPhone toggle buttons won't switch on

    I have a new iPhone 3GS, but under Settings - Mail Contacts Calendars - My .Mac account, I cannot get the toggle buttons for Contacts, Calendars, Bookmarks and more importantly Find My iPhone, to switch to 'ON'. Mail however is 'ON'. When I click them to 'on' they just immediately turn themselves off again. This means that my iPhone does not show up in my .Mac/MobileMe account and therefore Find My iPhone will not work.
    As far as I can see everything is set up correctly. I've looked through posts here, read Apple's suggestions, but none of these will switch to 'On'.
    Fetch New Data is set to Push. Fetch is set to every hour. Location services are On.
    In iTunes, Mail Contacts Calendars Bookmarks are all set to sync.
    Under Account Info for my .Mac/Mobile Me account I am still using the older .Mac settings as I still prefer my [email protected] email address - could this have anything to do with the problem? Should I try deleting the account manually and re-adding it manually with the new Mobile Me settings?
    When I set up my iPhone 3GS I used the backup of my old 1st Generation iPhone to set up the new phone in iTunes. The settings above wouldn't toggle on the old phone either, so I wonder if I have inadvertantly brought a bug across by restoring from the old phone backup?
    Really puzzled now. Has anyone come up with a solution or is it a problem at Apple's end?

    OK, solved my own problem! For anyone else having the same sort of problem, all I did was to manually delete my .Mac/MobileMe email account on my iPhone completely, shut down the iPhone completely, switch it on again, and manually add my .Mac/Mobile Me account back on the phone - this time using my address as [email protected], forcing it to use the me.com servers instad of my older .Mac servers.
    Instantly I was able to toggle the buttons and switch on Find My iPhone, which is now showing up online in my .Mac account.
    Now I've just got work out how to change my outgoing email address back again to [email protected] because I HATE @me.com! It's a horrible email address, and sounds really self-important.

  • What's wrong with my toggle button bar?

    I've used one before, and I don't understand why my toggle
    button bar is not showing the "active" state for the first index of
    the viewStack it is linked to.
    Normally, I use mainStack.selectedIndex = 0 and that
    highlights the first (default) item of the view stack.
    I change the viewstack with a timer, and all subsequent
    states the correct button highlights, even when I have it loop
    around to the first item again. It's only initially on load.
    Thoughts?

    Thanks, Greg.
    That didn't work either, but it got me thinking. Moving it to
    the end of the function that assigns the children to the view stack
    finally worked:

  • Image in a microsoft toggle button activex

    HI
    I cannot put an picture in a control button(MS Active X) because i do not
    know the type of the proprties "Picture"
    Thanks

    Thomas Esposito wrote
    > i do not know the type of the proprties "Picture"
    > Thanks
    ==========================================
    Hi Thomas,
    Microsoft ActiveX Toggle Button takes following picture file formats in most
    environments (and I think Labview shouldn't be an exception)
    *.(bmp, dib, gif, jpg, wmf, emf, ico) and cur and may be some more
    For inserting picture recommended method is to use properties browser and
    choose the property picture. It is expected that you see a prompt that will
    open load picture dialog box.
    HTH
    Cordially,
    Rishipa
    All reply to this newsgroup please
    ==========================================

  • Toggle button does not work correctly in project preview

    Hello,
    I am working on a project and recently discovered the "toggle button" advanced action that lilibiri posted (Love the toggle button!!). Initially i had used the rollover funktion but found out via html5 tracker, that rollover is not supported by html5 and tablets. To the problem: When I test the slides individually everything works fine. As soon I preview my project and click on my smartshape buttons that toggle the image/text, the project jumps back to previous slides. Now, i probably do not understand the conditional action in terms of what it is actually telling CP to do. So i am guessing it is a user problem. I would be super greatful to anyone who can help me solve this, since i am bound to a dead line to finish this. THANKS!!
    -N
    Here are some screenshots of the conditional actions (its in german..."Ausdruck" is Expression, "Einblenden" is Show, "Ausblenden" is Hide

    Hello,
    You are mixing up Frames with Slides. Try:
    Expression  cpCmndGotoFrame = cpInfoCurrentFrame -1
    Lilybiri

  • How Do I Make a Toggle Button

    How would I do this?
    I want to create a toggle button, so when the button is in
    it's default position it says "Sound On" and when clicked again it
    says "Sound Off" etc.

    Comp. 792 wrote:
    > How would I do this?
    >
    > I want to create a toggle button, so when the button is
    in it's default position it says "Sound On" and when clicked again
    it says "Sound Off" etc.
    There is many ways to achieve that.
    You could have movie clip with two frames, button in frame 1
    with action go to nextFrame()
    and button in second frame with action go to prevFrame(); so
    they would toogel each other
    back and forth.
    You could have one movie clip with single frame and just an
    action on timeline frame:
    sound1 = new Sound(this);
    sound1.attachSound("loopSound");
    sound1.start(0, 999);
    buttonName.onPress = function() {
    (playing=!playing) ? sound1.stop() : sound1.start(0, 999);
    (give button instance name "buttonName" and you all set ....
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Toggle button problem..really urgent

    hi there.. i have a problem with my code and i hope someone can help me as i have a dateline to meet for my programme..
    i have a set of 10 toggle buttons with 1 single actionlistener..
    here is the code
    p3=new JPanel();
    b1=new JPanel();
    ActionListener listener1 = new b1();
    for (int i=1; i<=10;i++)
    JToggleButton button1 = new JToggleButton(("A"+i));
    button1.addActionListener(listener1)
    b1.add(button1);
    p3.add(b1);
    whenever the user activates a button, a textarea below will show the name of the button..
    for example.. if user clicks on A3.. it will appear A3 below..
    this is my code below of wat i have done..
    public class b1 implements ActionListener
    public void actionPerformed(ActionEvent e)
    Object source = e.getSource();
    textarea1.append(((JToggleButton) e.getSource()).getText()+",");
    my problem is this.. if the user were to deactivate the button,the textarea below will not show anything..
    for example, if user click on A4, it should appear A4 in the textarea and when user click on A4 again, the textarea should not show A4 again.
    and if user click on 2 buttons example A1 and A5
    textarea should show A1, A5
    and if user click on A1 again, the textarea should juz show A5 and A1 should not be there.
    any help would be greatly appreciated..=)

    i created 2 sets of buttons like this..
         //Buttons that Starts with A
         b1 = new JPanel();
    JToggleButton[] buttons1 = new JToggleButton[11];     ToggleButtonListener1 listener1 = new ToggleButtonListener1(buttons1);
              for(int i=1; i<buttons1.length; i++)
              buttons1[i] = new JToggleButton("A" + i);
                   buttons1.addActionListener(listener1);
              b1.add(buttons1[i]);
              p3.add(b1);
         //Buttons that Starts With B
              b2 = new JPanel();
         JToggleButton[] buttons2 = new JToggleButton[11];
         ToggleButtonListener1 listener2 = new ToggleButtonListener1(buttons2);
              for(int i=1; i<buttons2.length; i++)
              buttons2[i] = new JToggleButton("B" + i);
              buttons2[i].addActionListener(listener2);
                   b2.add(buttons2[i]);
                   p3.add(b2);
    i bind these 2 groups of buttons in a single actionlistener like this
    class ToggleButtonListener1 implements ActionListener
         private JToggleButton[] array;
         public ToggleButtonListener1(JToggleButton[] array)
              this.array = array;
         public void actionPerformed(ActionEvent e)
              ta1.setText("");
              for(int i=1; i<array.length; i++)
              if(array[i].isSelected())
         ta1.append(array[i].getText() + ",");
              continue;
    the problem i have now is that the 2 sets of buttons are not displayed on the textarea..
    for example if user clicks on A1, the textarea should appear A1 and if user clicks on B1, the textarea should display both A1 and B1.. how do i do that..?

  • Toggle Button in a selection screen

    Hey Folks,
    I am pretty new to Screen/Selection Screen programming. I want to how does one go about adding a toggle button in a selection screen?
    The toggling of a button should trigger
    1) Toggling between visibility of blocks
    2) Toggling the name of the button
    3) Toggling the icon on the button
    Lastly what is the icon for an expan/collapse operation?
    Thanks,
    Puja.
    Edited by: Puja Malhotra on Oct 2, 2008 8:14 AM

    Toggling was made possible with the loop at screen during selection screen output

  • Word 2010 Ribbon toggle button page size feedback

    For a Word template I am developing a custom ribbon for end-user ease of use and to protect the structure of the document. There is one issue I am currently running into for which I cannot find a solution.
    It started with a footer image which needs to be rescaled with the page width (page size and orientation) while retaining its aspect ratio. Apparently this is not possible without VBA (tried fill image for shape and set relative width, but that leaves
    the height fixed), so now the idea is to get a pull-down menu with toggle buttons for page size and orientation and change the image size using a macro. The options are A4 portrait, A4 landscape, A3 portrait and A3 landscape. The problem now is how
    to get the run-time feedback of page size and orientation to highlight the page setup of the active section, like the built-in size and orientation buttons.
    Hopefully this can be done.

    Hi AlexFolmer,
    Sorry for the delay.
    >> Create a custom ribbon menu with buttons to select the paper size, this can be done without too much effort. However, if this is to be implemented I would like the button representing the current paper size/layout to be highlighted in the same way
    as the Word native paper size/orientation buttons do
    Do you mean that you want to create a custom ribbon menu for user to select the Page size, and when you click the ribbon button, the current page size could be highlight. In my option, you could do as below:
    1.  Add a Combobox into the custom ribbon, set the items with “Item1”, “Item2”
    2. Add event to comboBox1_TextChanged, key code like below:
    private void comboBox1_TextChanged(object sender, RibbonControlEventArgs e)
    if (comboBox1.Text == "Item1")
    Globals.ThisDocument.PageSetup.PaperSize = Microsoft.Office.Interop.Word.WdPaperSize.wdPaperA3;
    else if (comboBox1.Text == "Item2")
    Globals.ThisDocument.PageSetup.PaperSize = Microsoft.Office.Interop.Word.WdPaperSize.wdPaperA5;
    For combobox, it has the function to highlist the selected item. At this time, we need to solve the issue for opening the document, the combobox would show the current pagesize. You could refer the code below:
    private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
    if (Globals.ThisDocument.PageSetup.PaperSize == Microsoft.Office.Interop.Word.WdPaperSize.wdPaperA5)
    comboBox1.Text = "Item2";
    You could refer the link below for more information about Globals.ThisDocument.PageSetup.PaperSize
    Reference:
    https://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.pagesetup.papersize(v=office.11).aspx
    In addition, if you have issues about PageSetup.PaperSize, I will recommend you post a new thread.
    The reason why I suggested is:
    #1 There would be more community members to discuss the question.
    #2 For people who have the similar question, it would be easier for them to find the answer from a specific thread.
    Best Regards,
    Edward
    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.

Maybe you are looking for