LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Container Display Issue

Solved!
Go to solution

I have created a .NET control for use in a LabVIEW application.  The control visually looks as I would expect when run outside of LabVIEW, however, when I add the control to a .NET container inside LabVIEW the graphical display changes slightly.  See below for how it looks normally:

 

NativeDotNetVersion.JPG

 

This is how LabVIEW is rendereing it:

 

LabVIEWDotNetContainerVersion.JPG

 

It mostly looks like formatting differences from what I can tell (i.e. the text is italicized and rendered differently, the Message label is moved down slightly, etc.).  In my particular case, formatting is important as a visual indicator to the user (and there is more to the control than what I show in the screenshots).  Is it possible to render the control like it is in the first picture via LabVIEW?  I have tried stopping the Windows Themes service, based on other LabVIEW help documents I found, but that didn't stop the text from being formatted differently.

 

Thank you in advance if anyone has any advice!  Please let me know if you need any clarification.

0 Kudos
Message 1 of 7
(3,795 Views)

Hi there, 

 

Yes it seem to be formatting settings. Can you attached your VI to see What I can do to help you. And can you specifically write step by step what  did you do, and what did you use in your VI jut to reproduce your issue

 

Best Regards

0 Kudos
Message 2 of 7
(3,757 Views)

@keroba

Thanks for the response, however it won't be of any value to attach the VI in this case.  The VI itself is blank except for the .NET Container.

 

Here is what I did:

 

  1. Add .NET Container to Front Panel
  2. Right-click the .NET Container and select Insert .NET Control...
  3. I browse and select the DLL I created which holds the .NET User Control

At this point the .NET Container is holding my User Control but already the formatting issues are taking place and I haven't even run the VI yet.

0 Kudos
Message 3 of 7
(3,746 Views)

Hi there, 

 

Is it possible that you can attached your DLL just to simulate your issue in my computer. By the way what LabVIEW version do you have?

 

Regards

0 Kudos
Message 4 of 7
(3,727 Views)

I created another DLL file for testing purposes and have attached it.  See below for screenshots:

 

 

This is how the UserControl renders in Visual Studio.  All text is unformatted and should look regular.

 

CorrectAppearance.jpg

 

This is how the UserControl is rendered in LabVIEW.  Notice the text formatting on the label and the button (the text is actually truncated on the label).  Coincidentally, when you activate the Combo Box, the items in the drop down appear normal and not italicized.  Likewise for the message box that appears when you click the button.

IncorrectAppearance_LabVIEW.jpg

 

 

I am using .NET Framework 4.5 (in Visual Studio Professional 2012) and LabVIEW 2014 (Version 14.0f1 32-bit).

0 Kudos
Message 5 of 7
(3,680 Views)
Solution
Accepted by topic author VineAndBranches

Hi there,

 

I try your dll in my computer and it works just fine. 

 

IMAGE$1086363A97FBFCFC.jpg

 

So I tried to change the letters and I found a way to change it!

 

In labview, lets go to Tools>>options>>enviroment>>Fonts (scroll down to find this option)>>Application Font>> uncheck the "Use default font">> click on "Font Style">>select the style that you want>> check the "Panel default">>OK.

 

Doing those steps was the way that I changed the font style on the containers like the .Net container

 

Regards

Message 6 of 7
(3,630 Views)

@keroba, thanks for the additional followup and details.  You definitely led me in the right direction with the Tools > Options > Environment > Fonts settings. 

 

I also needed to shrink the default font size from 15 to 14 (you can see in the picture you posted that the label, although not italicized anymore, is still truncated) in order for the whole label to fit.

 

Not sure if there is a more "automatic" way of dealing with this but at least this is a work-around.  Thanks!

0 Kudos
Message 7 of 7
(3,595 Views)