Profile Picture

Buttons

Posted By Damien Drummond 7 Years Ago
Author
Message
Damien Drummond
Question Posted 7 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 7 Years Ago
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.



Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:38 AM
Posts: 3,054, Visits: 4,006
Hi,

To start with NOV it's best to use the NOV project templates that should become available in the New Project dialog of Visual Studio after you install Nevron Open Vision under "Installed -> Templates -> Visual C# -> Nevron Open Vision". Check out this KB article for more information.

Regarding Windows Server 2012, NOV should run fine on it. Please double check and make sure that you deploy all required assemblies with your project.

UI themes assign different appearance to the different states of UI widgets through a CSS-like styling system. That is why when you set local style to your button, it overrides the styles for all states and the button looks the same when its hovered or clicked. If you want to define your own theme we recommend you take a look at the documentation topics related to themes - start with UI Themes Overview. Another important topic is the Part Based Themes topic and especially the Color Skins sections.

You can apply themes to your application by calling: NApplication.ApplyTheme. It is best to call it in the entry point of your application (the "Program.cs" file for WinForms application), just after you have initialized (installed) NOV for your application.


Best Regards,
Nevron Support Team



Damien Drummond
Posted 7 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 7 Years Ago
Posts: 10, Visits: 24
So firstly, I do not have anything relating to Nevron in my new projects window so I have a standard WinForms app I am trying to test this with and every turn there is a brick wall and I waste hours and get nowhere.

So how can I get the Nevron template choices for a new project, and do I have to start a Nevron Windows Form app to be able to easily and successfully use your components in an application?

I have struggled relentlessly reading through some information and it just makes no sense to me. I can't even look at the live demos, as it always says I need Silverlight and I have it already installed, and it doesn't matter what browser I use I get the same issue.

At this stage (and I can say it is because I am new to it) I can't get anywhere, other than a basic button, which I can easily do with C# native, and is not what I was wanting to do.

Thanks for your help

Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:38 AM
Posts: 3,054, Visits: 4,006
Hi,

Nevron Project templates may be missing if you are using the free (Community) edition of Visual Studio or if an error has occurred while installing NOV and the templates were not properly installed. You can take a look at the Hosting NOV in Windows Forms for detailed instructions how to integrate NOV in an existing WinForms application.

If you are interested in any of the special NOV controls (diagram, chart, rich text editor, schedule, etc.) please drop us an e-mail and we will send you a sample WinForms application, so that you can start using NOV as quickly as possible.

Regarding the online examples, please use a browser that still supports Silverlight, for example Internet Explorer 11.

Best Regards,
Nevron Support Team



Damien Drummond
Posted 7 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 7 Years Ago
Posts: 10, Visits: 24
Firstly, yes I am using the Community version (even though I have access to Professional)
Secondly, I tried it in Edge, Firefox and Chrome and then forced Edge to use IE11 under Windows 10 and I finally got to see your demos, can't see why it wasn't working okay on other browsers, that have silverlight enabled.

Lastly, I am struggling enormously with your documentation - it is so light on, unless I am looking at the wrong pages? I may be new to your product, but I have a complete (and working) WinForms application using the standard controls, and all I want to do is use better looking controls (like I can in a WPF application), and rightly or wrongly I thought your product was going to be the "simple" solution.

Bottom line is that I AM interested in your products, but if they are not simple to use and theme during my testing phase, due to little to no documentation, examples, etc. then I can't see myself using them and I will evaluate something else.

I have emailed support requesting the theme examples so I can look at creating a custom theme - I am STILL waiting, so if it also takes ages for a response from support, I will also question whether I need to evaluate something else.

At the moment, I am just trying to use an NComboBox and where I could use the following in a normal ComboBox, I can't for the life of me get it to work with yours...

This is to set the selected item to the given text...
Standard Combo - LocationsCombo.SelectedItem = "My Text Value Here";
Trying with yours - nComboBoxControl2.Widget.SelectedItem = "My Text Value Here";

So the error that shows is that you cannot implicitly convert type "string" to "Nevron.Nov.UI.NComboBoxItem" - so how else am I meant to do it - nothing of any value in the online documents, or anywhere else for that matter?

I also see there is no event "DropDownClosed", but I was able to work around that using "SelectedIndexChanged"


Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:38 AM
Posts: 3,054, Visits: 4,006
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
Posted 7 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 7 Years Ago
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
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:38 AM
Posts: 3,054, Visits: 4,006
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



Damien Drummond
Posted 7 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 7 Years Ago
Posts: 10, Visits: 24
Thanks for the information, but there was no answer to my problem...

I use the code I gave and the Closed event does not fire!! Even if I am using your controls from the toolbox, shouldn't it still fire?

If I follow your code, you create a Stack Panel to contain the NOV controls - is this essential? Does this then still interact okay with the rest of the components, even if they are stock ones?

I have tried to use your coding method - so dockstyle wills the entire window, but then I add my combobox, it doesn't get placed where I want it to, doesn't get filled with the data I have already coded for the combobox items and is stretched across the top of the app window - doesn't look like this is a winner for me!!

//PracticeLocationsCombo
NComboBox PracticeLocationsCombo = new NComboBox();
PracticeLocationsCombo.Location = new NPoint(92, 92);
PracticeLocationsCombo.Size = new NSize(200, 27);
stack.Add(PracticeLocationsCombo);


With the combobox, I add the items programmatically from a SQL database when the application opens, so how do I now do it if I am using your method? When the combobox closes it needs to set focus to a stock standard DataGridView (which will not be in the Stack Panel, so I assume that my coding will not change for this?

Also, does it mention anywhere in the documentation to use "Widget" if you don't create it in code and use the provided Widgets from the toolbox, I stumbled upon how to do it by accident? And lastly, why does it matter which way I use your controls, shouldn't I still have access to all the events and also find out what the heck these events are somewhere in some document? I can't find anywhere that there is a Closed event relating to the ComboBox.

Your support has been great, I can't fault it, you are extremely helpful and patient, but I seem to take a step forward and stop (or take a few back) because there is nothing anywhere to be able to assist me in moving forward without me contacting you - all of this could be avoided with clearer documentation and the wait is adding time pressure on this project. I code from a Design, not create a design from code - that may not be how everyone does it, but for me, I find it is the best as the interface with the client is extremely important to me and I need to see it.

The current application is a small part of a huge project, and I decided to try your controls with this component because it was relatively small and easy to code, but at this stage, I have spent more than a week just trying to style your components, the rest of the application is complete. So, I would like to continue with the large component, but I can't afford to spend months sending through questions, just to style a component, the project would balloon out for months and months.

The following questions I have asked still have not been answered anywhere...
1. How do I add a Tooltip to your buttons, the standard way for stock buttons doesn't work?
2. Can I have multiple themes, as I have different components/modules that currently has a different color scheme, Green, Blue and Red - so if the user clicks and changes to the module with say the red based theme and they are in the green module, then I need to be able to change themes on the fly - is this possible?

Just letting you know...
The Subscribe to Email still is not working, so I have no notification that you respond. Also, the live demos (on Windows 10 system) only works forcing Internet Explorer - Edge and FireFox do not work at all. Lastly, trying to read through the online documentation is like watching grass grow, no matter what browser is used, clicking on something, trying to search, etc. is painfully slow.

Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:38 AM
Posts: 3,054, Visits: 4,006
Hi,

You can use NOV controls from the toolbox, too, and they should work the same way they work when created through code. The only thing you are sacrificing when using the designer is portability of you code, because the WinForms designer generates platform specific code. This means that if want your NOV application to run on other platforms, too (i.e. to be cross platform) you should create your UI through code as shown in our previous post.

Regarding the combo box popup closed event, we tested it and it works fine even for NOV controls from the toolbox. Please try the following code:
NComboBox comboBox = nComboBoxControl1.Widget;
comboBox.Items.Add(new NComboBoxItem("Item 1"));
comboBox.Items.Add(new NComboBoxItem("Item 2"));
comboBox.Items.Add(new NComboBoxItem("Item 3"));
comboBox.SelectedIndex = 0;
comboBox.Popup.Closed += OnComboBoxDropDownPopupClosed;

private void OnComboBoxDropDownPopupClosed(NEventArgs arg)
{
    NPopupWindow popup = (NPopupWindow)arg.TargetNode;
    NComboBox comboBox = (NComboBox)popup.ParentNode;
    // Your code here
}


The NOV stack panel is just one of the layout panels you can use to automatically arrange your controls. For more information about panel, check out the Panels Overview topic and the other topics in the Panels folder. We are aware about the slow opening of the online documentation. It is caused by some server issues, so we are going to upgrade the help documentation server soon to resolve this issue. Until then you can use the local documentation that comes with the NOV installation in the form of a CHM file. You can find it in the NOV folder in the Start menu of your computer.

The placement of a NOV widget in its owner container is controlled through the widget's HorizontalPlacement and VerticalPlacement properties. They are by default set to Fit for most widgets and that is why you see them stretched. Change the values of these properties to a value you want. If you are using layout panels, don't forget to also set the panels HorzontalSpacing and/or VerticalSpacing properties in order to add some spacing between the widgets hosted in the panel.

The online examples of NOV use Silverlight, but unfortunately most major browsers already dropped support for it. That is why if you want to run the online examples, we recommend you use Internet Explorer. Please note that all of the examples also come with the NOV installation, so you can run them from your computer's start menu and evaluate their code.

Regarding your last 2 questions:

1. You can add a tooltip to any widget using its Tooltip property:
button.Tooltip = new NTooltip("My tooltip");


2. You can easily apply a new UI theme to your application using the ApplyTheme static method of the NApplication class:
NApplication.ApplyTheme(new CustomTheme());




Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic