Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8357145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:23:30+00:00 2026-06-09T10:23:30+00:00

I am working on a program to manage a minecraft server with a local

  • 0

I am working on a program to manage a minecraft server with a local UI as well as a remote interface. I have a button on a ribbon bar that will enable or disable the remote interface and a textbox for inputting the port. Currently, I disable the textbox when the networking is enabled, but, disabling does not re-enable the textbox after I set it to true again (and setting a breakpoint reveals it to still be false).

    private void NetToggleChecked(object sender, RoutedEventArgs e) {
        portTextBox.IsEnabled = false;
        if (ButtonPressedByUser) {
            var result = MessageBox.Show("Are you sure you want to enable networking with the current settings?" +
                                         " If not properly configured, it may be possible for an attacker to enter your server.",
                                         "Simple Bukkit Wrapper", MessageBoxButton.YesNo, MessageBoxImage.Warning,
                                         MessageBoxResult.No);
            if (result == MessageBoxResult.No) {
                ButtonPressedByUser = false;
                NetworkToggle.IsChecked = false;
                ButtonPressedByUser = true;
                return;
            }
        }

        Config.NetConf["enabled"] = "true";

        int port;
        if (!int.TryParse(Config.NetConf["port"], out port)) {
            MessageBox.Show("Port could not be parsed (is it a number?)");
            ButtonPressedByUser = false;
            NetworkToggle.IsChecked = false;
            ButtonPressedByUser = true;
            return;
        }

        Net.Listener.StartListening(port);
    }

    private void NetworkToggleUnchecked(object sender, RoutedEventArgs e) {
        portTextBox.IsEnabled = true;
        if (ButtonPressedByUser) {
            var result =
                MessageBox.Show("Are you sure you wish to disable all networking to your server? It will " +
                                "be impossible to connect to it remotely and any existing connections will be closed.",
                                "", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No);
            if (result == MessageBoxResult.No) {
                ButtonPressedByUser = false;
                NetworkToggle.IsChecked = true;
                ButtonPressedByUser = true;
                return;
            }
        }

        Config.NetConf["enabled"] = "false";
        Net.Listener.StopListening();
    }

Thank you for any help resolving why the textbox will not enable again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:23:32+00:00Added an answer on June 9, 2026 at 10:23 am

    Old Question but i kept coming across it while searching for an answer so figured i’d post an answer anyways. There is a bug in the ribbonTextbox control that results in isenabled always being false if there is no command associated. There are 2 ways round this from what i have found:

    1: Create a new control based on the ribbontextbox and override the isenabledcore property to always return true. As shown here Cannot set RibbonTextBox isEnable to False

    2: Create a dummy command and associate it with the control

    public static readonly ICommand DummyCommand = new RoutedCommand("Dummy", typeof(Control));
        public static void Dummy(Object sender, ExecutedRoutedEventArgs e)
        {
            // Do nothing its a dummy command
        }
        public static void CanDummy(object sender, CanExecuteRoutedEventArgs e)
        {
            e.CanExecute = true;
        } 
    

    as described in a comment in this link http://blogs.msdn.com/b/wpf/archive/2010/10/21/wpf-ribbon-october-2010-update-details.aspx .
    AS i said probably no help to the original poster but i kept coming across it while looking for an answer so it may save someone else a few minutes of googling time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, Forum. I'm working on a program in Python that uses Twisted to manage
I have a working program in C++ that generates data for a Mandelbrot Set.
I'm working on a program to store and manage test results. Tests have properties
Is it possible to have a server side program that queues and manages processes
I'm working on a program that will work very nicely with a database structure
I've a managed Explorer Bar (working in Internet Explorer) that is working reasonably well.
I am working on a background program that will be running for a long
I am working on a program to manage a Hotel in C++. I have
I have a program written in VB that has DataDynamics ActiveReports as well as
I have a working C program where the length of an array of strings

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.