Buttons


Author
Message
Damien Drummond
Damien Drummond
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 10, Visits: 24
Okay, so I am new to the software and have tried to use a button in my c# WinForm application.

I can create and use the button just fine, but I want a custom look, so if I set the Background Fill to "Stock Gradient Fill" or anything else other than Automatic, I lose the hover over and click color changes.

I have looked everywhere to try and change this, but I can't locate it - what (basic) instruction am I missing?

I tried following some of the examples, and created a class file called MyFirstTheme - but how and where do I apply this to my project and is that what I actually have to do?

I want to set a theme/skin once and it then sets it for all the components added to my WinForm.

I am currently using Visual Studio 2017 Community, and after I installed NOV UI, I do not see what is shown in some of the instructions relating to creating projects (like creating a NOV Windows Form app) - did I install something incorrectly?

Lastly, I thought I would test the WinForm app on a Windows 2012 R2 Terminal Server and it crashes on loading, I am yet to dig into a little further, but is this compatible with Windows Server 2012 R2?

thanks.


Replies
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi,

We have sent you the source code related to NOV themes via email. We have also sent you a sample application that demonstrates how to create and apply a custom theme based on the built-in Windows 8 theme.

Regarding your other question about setting the selected item of a combo box, you should use the IndexOfItemWithText method of the combo box like shown below:
comboBox.SelectedIndex = comboBox.IndexOfItemWithText("My Text Value Here", StringComparison.Ordinal);


Note that if you want to quickly fill a combo box from an array or from an enum you can use the FillFromArray and FillFromEnum methods, respectively. For more information check out the Combo Box documentation topic.

Best Regards,
Nevron Support Team


Damien Drummond
Damien Drummond
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 10, Visits: 24
The only way I get this to work is if I use the word Widget in the code...

comboBox.Widget.SelectedIndex = comboBox.Widget.IndexOfItemWithText("My Text Value Here", StringComparison.Ordinal);


I am actually having to use "Widget" everywhere to get anything to work using your controls.

The "Subscribe to Email" feature of this forum does not seem to be working, as I am never notified of any of your posts.

Thanks.


Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi,

If you are using the NOV controls from the toolbox, then yes, you will have to use the Widget property of each control to access the NOV widget hosted in it. Please note that if you use controls from the toolbox you are sacrificing the portability of your code, which is one of the greatest powers of NOV. If you code your application directly by using NOV widgets instead of WinForm controls via the Visual Studio designer you will be able to compile and run your application on all platforms supported by NOV (currently Windows (WinForms and WPF), Mac and Silverlight) from a single codebase.

The following is a simple example that shows how to create some NOV widgets directly in code without using the Visual Studio designer - the NOV UI is created in the CreateNovContent method:
public partial class Form1 : Form
  {
   public Form1()
   {
      InitializeComponent();

      // Create the NOV content and place it in a NOV widget host on the form
      NWidget novContent = CreateNovContent();
      NNovWidgetHost<NWidget> host = new NNovWidgetHost<NWidget>(novContent);
      host.Dock = DockStyle.Fill;
      Controls.Add(host);
   }

   private NWidget CreateNovContent()
   {
      NStackPanel stack = new NStackPanel();
      stack.Padding = new NMargins(NDesignConstants.HorizontalSpacing, NDesignConstants.VerticalSpacing);
      stack.VerticalSpacing = NDesignConstants.VerticalSpacing;

      // Create a button
      NButton button = new NButton("Button");
      stack.Add(button);

      // Create a button with image and text
      NButton imageButton = NButton.CreateImageAndText(Nevron.Nov.Presentation.NResources.Image_File_Open_png, "Open");
      stack.Add(imageButton);

      // Create a check box
      stack.Add(new NCheckBox("Check Box"));

      return stack;
   }
  }


For more information on hosting NOV in a Windows Forms application, you can check out the Hosting NOV in Windows Forms documentation topic.


Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search