Toggle button text

Hi there,
I have a button that is rendered using an alternative template, I am trying to toggle the text when it is clicked, using javascript, in the optional url redirect section I call a javascript fuction like so...
javascript: myfunction(this)
in the function, I have tried changing the text of the button, but the this parameter appears to be undefined, and there is no way to access the page item via the +$x+ function because there is no id rendered on the page for the item. Any help woudl be much appreciated, thanks... Anil
Edited by: aparm on 29-Apr-2010 08:01

I don't have an onclick event because the button is template based and is rendered as an anchor, and the function show/hides a control in addition to which I would like to change the button text. Is this possible in apex?
Thanks...

Similar Messages

  • 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

  • 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.

  • 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.

  • How to create a toggle button which has some id associated with it

    Hi all,
    This is my problem
    <formid><some value in a text box><toggle button>
    here formid is a hidden parameter.
    There can be multiple records of this type...the user can change the text box as well as toggle any record.
    Now im unable to create a toggle button such that it is related to the formid as in when a user toggles between two values i want to be able to link that button with the form id.

    Assign an ID to the button? I don't fully understand the problem either.

  • How to place toggle buttons in webui

    Hello,
    How to add toggle buttons in webui.
    I kept three button for status in quotation as open inprocess and completed.
    But problem with button is we are unable to find in which status the quotation is.
    so I want place toggle buttons instead of button so that the selected button will be highlighted which resembles current status.
    But toggle buttons are not working in bsp application.
    Please specify how to solve this problem.
    Thanks For Upcoming Help.
    Regards,
    Tejaswy.

    Hi Teja,
                     If your requirement is to add three buttons based on the status , then here are the steps:
    1. In the view BT115QH_SLSQ/SQHOverView , redefine the method IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS.
    2. Get the current context node value 'BTADMINH'.
    3. From the relations "BTHeaderStatusSet" you get the status details.
    4. write the code
        ls_button-text = 'Open'
        ls_button-on_click = 'Open'.                         
        ls_button-page_id  = me->component_id.
        IF status = 'Open'.
        ls_button-enabled  = 'X'.
        ENDIF.
        APPEND ls_button TO rt_buttons.
        ls_button-text = 'InProcess'
        ls_button-on_click = 'InProcess'.                         
        ls_button-page_id  = me->component_id.
        IF status = 'InProcess'.
        ls_button-enabled  = 'X'.
        ENDIF.
        APPEND ls_button TO rt_buttons.
        ls_button-text = 'Complete'
        ls_button-on_click = 'Complete'.                         
        ls_button-page_id  = me->component_id.
        IF status = 'Complete'.
        ls_button-enabled  = 'X'.   
        ENDIF.
        APPEND ls_button TO rt_buttons.
    Hope this helps.
    Regards,
    Ruby.

  • Toggle Buttons for multiple images

    I just watched a video from lilybiri about standard and simple actions and then followed into her blog for the text caption toggle buttons.
    Now reading through that, there was if statements suggesting you can toggle between the values of 1 and 0 to make visible/invisible. Can this be done with more than 2 images? I am more interested in having a toggle feature where I can have 3 or 4 images and toggle the images to see changes in detail within those images. It seems like it has to be possible, but I'm not getting it.
    Also, is there a way that if you have a toggle button, or two perhaps, that you can have the button be displayed as if it was pushed? I know how to make buttons, I'm just wondering if there is a feature to display the button as the _down version until I re-select it, or toggle it off as it were.
    Thank you!

    You will need a conditional action, perhaps use a variable for each button that will be set to 1 if the button is pushed and to 0 if it is free.
    Didn't check it out but action will be something like this:
    IF v_bt1 is equal to 0
        Assign v_bt1 with 1
        Show im_down1        which is the image of the down-state
        Show Image1             which is the image you want to show
        Hide Image2
        Hide Image3
    ELSE
       Assign v_bt1 with 0
       Hide im_down1
       Hide Image1
    You'll have to test, it is too late over here for me to do some testing. I added the hiding of the two other images, because if the user doesn't toggle the buttons for those images to hide them, I think you want to hide them automatically. Perhaps better also hide their correspondent down-states? Be sure to have the image of the down-state on top of the button in the timeline panel.
    And if you ever want to return to the slide, have an on Enter Slide action that hides all the down and real images.
    Lilybiri

  • Problem with toggle button

    hi there... i have a problem with my toggle button that i created..
    the programme is simply like this. It's a virtual ticket machine where users can enter the number of tickets they want to buy and after which they can book their seats.
    for example, if user enters 4 tickets, he can only book 4 seats and so on.
    i've created a toggle button for the seats..
    here is my 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);
    this is my action listener for the buttons i've created
    public class b1 implements ActionListener
    public void actionPerformed(ActionEvent e)
         Object source = e.getSource();
         ta1.append(((JToggleButton) e.getSource()).getText()+"," );
         (when user deactivates the toggle button, how do i get the text area to clear)          
    any help will be greatly appreciated..=)

    Item Renderers are" recycled" by Flex as they scroll in and out of view. So when you change a button's selected state to true and then scroll around, that renderer ends up getting recycled to another item and causes this to look wrong.
    The trick is you have to make the item renderer update itself. there are many ways. One sure-fire way I tend to fall back on is to add a property to the data provider, then bind to that in the renderer-changing it as needed.
    1) When you set up your data provider, add a new property "toggled" as a boolean:
    private function init(event:Event):void
    //populate array with 50 items
    for (var i:uint=1; i<51; i++)
    itemAC.addItem({label:"B"+i, toggled:false});
    2) Now change your renderer, binding the selected property of the button to this new prop.
         Also, add a bit of code to the change event of the button:
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="150" height="150">
    <mx:Button id="btn" label="{data.label}" x="25" y="66" toggle="true" width="100"
        change="{data.toggled = btn.selected}" selected="{data.toggled}" >
    </mx:Button>
    </mx:Canvas>
    Result: the item renderer now looks to its data property to decide how to behave, and will have the proper state (selected or not) no matter if it gets recycled to another item in your data provider or not.
    HTH

  • 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);
    }

  • Does ios 6 have a 3g toggle button for iphone 4s?

    does ios 6 have a 3g toggle button for iphone 4s?

    rajatadv wrote:
    does ios 6 have a 3g toggle button for iphone 4s?
    Yes it does, the iPhone 4 had this feature but when the iPhone 4S was originally launched it did not. After upgrading to iOS 6 you can now turn off 3G and therefore just use 2G. This saves battery life and can also help with ensuring a more reliable connection in areas with poor 3G coverage (i.e. the whole of the UK ).
    You can access this option by going to Settings - General - Mobile Data and then turning Enable 3G to off. Depsite the accompanying text implying it relates to only data this does complete turn off 3G mode since both voice and data use the same transmitter.

  • Button Text options

    Okay I have been working on C3 for 2 months. Subscribed to
    Lynda.com...ran tutorials checked every help link. The Fireworks
    Help function stinks. Editing button symbols, here's what you get
    when you querie button text.
    "Fireworks button symbols are a special kind of symbol. They
    have two kinds of properties: some properties change in all
    instances when you edit an instance of the symbol, and other
    properties affect only the current instance. Here's what you get
    when you querie button text.
    Fireworks button symbols let you take advantage of the
    convenience of symbols yet allow you to edit certain properties of
    a button instance, such as text, without affecting other
    instances."
    Just fabulous, really.....How? Adobe tells me that it can be
    done.....just not how.
    I import a 3 position button from the library. I use the 9
    slice tool to set the button size, enter the text in the properties
    box. Tried to change the font, style or even use the fonts in the
    styles tab....no luck. I'm just
    trying to make a few buttons for a web page, why is it soo
    hard? Why does the help link not walk you
    through the process? Nothing in Lynda.com tutorial.

    RobaloBill wrote:
    > Just fabulous, really.....How? Adobe tells me that it
    can be done.....just not
    > how.
    Click on the button to select it, and then change the text on
    the 'TEXT'
    line in the Property inspector.
    > I import a 3 position button from the library. I use the
    9 slice tool to set
    > the button size, enter the text in the properties box.
    Tried to change the
    > font, style or even use the fonts in the styles
    tab....no luck.
    Double click on the button to open the button editor window.
    Change the
    font properties in the Properties inspector. Return to page
    1.
    Linda Rathgeber - Adobe Community Expert
    http://www.adobe.com/communities/experts/members/8.html

  • Changing quiz button text

    I am working on a series of tutorials and quizzes for our
    client, I want to change the text on the "Next" button on the
    quizzes. It appears easy enough, in the options, Next button text
    field, I have entered what I want, but it still appears as "Next"
    when I publish it. Am I an idiot?
    Please help.

    This may be a stupid question, but did you save the file
    before you published? I have sometimes had instances of not saving
    and publishing first and my changes are not reflected.
    Also, if the buttons were already on the screen with the text
    "Next" when you decided to change the button text, you'll need to
    delete those buttons and then add them again. The text does not
    update dynamically.
    Worst comes to worst, you can manually change the button text
    with a double-click or through properties...
    Hope that helps.

  • Button Text on Form not Displaying

    The following was posted by PGMR1998 at 09:58am on Feb 22, 2008 (Pacific) but got no response:
    I am using Adobe Acrobat Pro 8, and I have added a button to reset the form fields. The button has some text on top, but the text on the button does not display until I click down on the button in the preview pane. How can I make the button text visible always? Thanks in advance for your support..
    I'm having the same problem with the submit button on a form in Acrobat 9 Pro Extended. No matter what I do, the button text does not display. Any ideas?

    What font are you using? What is the font color set to? What font size? Can you post a sample somewhere?
    You specify the label text for a button using the Options tab of the Button Properties dialog. Describe each of the settings on this page. In particular, you can have a different label for the Up, Down, and Rollover states.
    George

  • Unable to define Radio Button Text field & unable to change column position

    Hi,
    While designing a screen in Screen Painter, I am unable to define Radio Button Text field as this option is not there in Graphical Element. And also I want to specify the starting position of column of that element different from the default value, but I am unable to define that because the field is non-editable.
    Can any one please help me out.
    Regards,
    Koushik

    Hi,
    Please find below the sample program from ABAP docu :
    PROGRAM demo_dynpro_input_output.
    DATA: input  TYPE i,
          output TYPE i,
          radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,
          box1(1) TYPE c, box2(1) TYPE c, box3(1) TYPE c, exit(1) TYPE c.
    CALL SCREEN 100.
    MODULE init_screen_100 output.
      CLEAR input.
      radio1 = 'X'.
      CLEAR: radio2, radio3.
    ENDMODULE.
    MODULE user_command_0100 input.
      output = input.
      box1 = radio1.
      box2 = radio2.
      box3 = radio3.
      IF exit NE space.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.
    Here radio1(1) TYPE c is defined within the program but in the element list there are RADIO1 element exist. One is actual radio button and the other is Radio Button Text.
    I am not able to create that radio button text using same object name.
    Please suggest.
    Regards,
    Koushik

  • Simple Button.Text not changing properly

    Hi all,
    The WPF learning curve is steep.
    I have pulled my hair over this simple Button.Text change and I can't get it to work.
    In WinForms this works:
    Public Class Form1
    Private Sub BTN_1_Click(sender As Object, e As EventArgs) Handles BTN_1.Click
    BTN_1.Text = "CLICKED BUTTON 1"
    BTN_2.Text = "CHANGED BY BUTTON 1"
    End Sub
    Private Sub BTN_2_Click(sender As Object, e As EventArgs) Handles BTN_2.Click
    BTN_2.Text = "CLICKED BUTTON 2"
    BTN_1.Text = "CHANGED BY BUTTON 2"
    End Sub
    End Class
    I want to do the same thing in WPF
    <Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
    <Grid.RowDefinitions>
    <RowDefinition/>
    <RowDefinition/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition/>
    <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Grid Grid.Column="0" Grid.Row="0">
    <Button Name="BTN_1" Click="CLICK_BTN_1">
    <StackPanel>
    <TextBlock Name="CLICK_BTN_1_LABEL_1" Text="Button 1 text" VerticalAlignment="Top" Foreground="#BF000000" >
    </TextBlock>
    <TextBlock Name="CLICK_BTN_1_LABEL_2" VerticalAlignment="Top" Foreground="#BF000000">
    <Run FontSize="25">Button 1</Run>
    <Run FontSize="12">Label 2</Run>
    </TextBlock>
    </StackPanel>
    </Button>
    </Grid>
    <Grid Grid.Column="1" Grid.Row="0">
    <Button Name="BTN_2" Click="CLICK_BTN_1">
    <StackPanel>
    <TextBlock Name="CLICK_BTN_2_LABEL_1" Text="Button 2 text" VerticalAlignment="Top" Foreground="#BF000000">
    </TextBlock>
    <TextBlock Name="CLICK_BTN_2_LABEL_2" VerticalAlignment="Top" Foreground="#BF000000">
    <Run FontSize="25">Button 2</Run>
    <Run FontSize="12">Label 2</Run>
    </TextBlock>
    </StackPanel>
    </Button>
    </Grid>
    </Grid>
    </Window>
    Class MainWindow
    Private Sub CLICK_BTN_1(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles BTN_1.Click
    ' CHANGE LABEL 1 ON BUTTON 1
    CLICK_BTN_1_LABEL_1.Text = "CLICKED BUTTON 1"
    ' CHANGE LABEL 1 ON BUTTON 2
    CLICK_BTN_2_LABEL_1.Text = "CHANGED BY BUTTON 1"
    End Sub
    Private Sub CLICK_BTN_2(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles BTN_2.Click
    ' CHANGE LABEL 1 ON BUTTON 1
    CLICK_BTN_1_LABEL_1.Text = "CHANGED BY BUTTON 2"
    ' CHANGE LABEL 1 ON BUTTON 2
    CLICK_BTN_2_LABEL_1.Text = "CLICKED BUTTON 2"
    End Sub
    End Class
    This used to be so simple with WinForms, what am I doing wrong here?
    New to WPF

    Yeah, I saw that as well but now I am stuck again:
    Same project but I have put the buttons in a usercontrol
    <Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Component_Changes"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
    <Grid.RowDefinitions>
    <RowDefinition/>
    <RowDefinition/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition/>
    <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Grid Grid.Column="0" Grid.Row="0">
    <Viewbox Stretch="Fill">
    <ContentControl Name="UC_BTN1">
    <ContentControl.Content>
    <local:btn1 Margin="20"/>
    </ContentControl.Content>
    </ContentControl>
    </Viewbox>
    </Grid>
    <Grid Grid.Column="1" Grid.Row="0">
    <Viewbox Stretch="Fill">
    <ContentControl Name="UC_BTN2">
    <ContentControl.Content>
    <local:btn2 Margin="20"/>
    </ContentControl.Content>
    </ContentControl>
    </Viewbox>
    </Grid>
    </Grid>
    </Window>
    btn1.xaml
    <UserControl x:Class="btn1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
    <Button Name="BTN_1" Click="CLICK_BTN_1">
    <StackPanel>
    <TextBlock Name="CLICK_BTN_1_LABEL_1" Text="Button 1 text" VerticalAlignment="Top" Foreground="#BF000000" >
    </TextBlock>
    <TextBlock Name="CLICK_BTN_1_LABEL_2" VerticalAlignment="Top" Foreground="#BF000000">
    <Run FontSize="25">Button 1</Run>
    <Run FontSize="12">Label 2</Run>
    </TextBlock>
    </StackPanel>
    </Button>
    </Grid>
    </UserControl>
    btn1.xaml.vb
    Public Class btn1
    Dim CL_BTN2 As btn2
    Private Sub CLICK_BTN_1(sender As Object, e As RoutedEventArgs) Handles BTN_1.Click
    ' CHANGE LABEL 1 ON BUTTON 1
    CLICK_BTN_1_LABEL_1.Text = "CLICKED BUTTON 1"
    ' CHANGE LABEL 1 ON BUTTON 2
    CL_BTN2.CLICK_BTN_2_LABEL_1.Text = "CHANGED BY BUTTON 1"
    End Sub
    End Class
    btn2.xaml
    <UserControl x:Class="btn2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
    <Button Name="BTN_2" Click="CLICK_BTN_2">
    <StackPanel>
    <TextBlock Name="CLICK_BTN_2_LABEL_1" Text="Button 2 text" VerticalAlignment="Top" Foreground="#BF000000">
    </TextBlock>
    <TextBlock Name="CLICK_BTN_2_LABEL_2" VerticalAlignment="Top" Foreground="#BF000000">
    <Run FontSize="25">Button 2</Run>
    <Run FontSize="12">Label 2</Run>
    </TextBlock>
    </StackPanel>
    </Button>
    </Grid>
    </UserControl>
    btn2.xaml.vb
    Public Class btn2
    Dim CL_BTN1 As btn1
    Private Sub CLICK_BTN_2(sender As Object, e As RoutedEventArgs) Handles BTN_2.Click
    ' CHANGE LABEL 1 ON BUTTON 1
    CL_BTN1.CLICK_BTN_1_LABEL_1.Text = "CHANGED BY BUTTON 2"
    ' CHANGE LABEL 1 ON BUTTON 2
    CLICK_BTN_2_LABEL_1.Text = "CLICKED BUTTON 2"
    End Sub
    End Class
    No warnings in the code but the error is: 'Object reference not set to an instance of an object' and I thought I did, obviously not in the right way.
    New to WPF

Maybe you are looking for

  • How to change an after login page?

    Does anyone knows how to change an after login page from a default page 1 to, let's say page 200?

  • Putting Logic on a second computer?

    I've been using Logic 7 on a PowerMac Dual 2.3 since last summer with no problem but now I'm trying to get it going on a new Dual 2.3 at home. First, a very rudimentary Logic appears, with only 4 audio tracks. Second, it won't allow me to add any aud

  • Java - XML mapping

    I want to generate/map a xml schema from a set of java classes (like JAXB or XMLBeans). This not for a web service implementation. Is there any I can use the autotype ant task available in weblogic webservice to achieve this ? Thanks, Siva

  • Airport problems (bug report)

    To put "the bottom-line up front", I'd like to know if anyone can put me in contact with Apple's Airport software engineers (or can forward this to them so a bug fix can be released). I have composed as detailed of a description of the bug as possibl

  • Applet Servlet Comm. Problem

    Dear friends, i have an applet that sends a serialized object to the servlet,the Servlet creates another object and passes it back to the applet. Everything works fine, till i read the object with: ObjectInputStream objInputStream = new ObjectInputSt