RTC 2013 Client Add-in Label Control
rkarnosh
Member Posts: 2
I am attempting to create a Client ControlAddin that will display a Page field as a label with different Fonts. I would like more options than the current Style Property gives me.
I have created the add-in, but the sizing of it does not seem to work. When I apply the ApplySize function to the control, it errors with no information.
When I comment out the ApplySize function, the control load into the client, but size and display are very strange.
Anyone ever attempt this? What am I missing on the Sizing of my control
Control Add-in Source:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Dynamics.Framework.UI.Extensibility;
using Microsoft.Dynamics.Framework.UI.Extensibility.WinForms;
using System.Windows.Forms;
using System.Drawing;
namespace AddInSamples
{
#region "Custom.NAV.FontLabel"
[ControlAddInExport("Custom.NAV.FontLabel")]
public class FontLabelAddin : StringControlAddInBase
{
protected override void OnInitialize()
{
base.OnInitialize();
this.ApplySize(new DisplaySize(101, 600, 1000), new DisplaySize(10, 20, 200));
}
/// Defines the Label control.
protected override Control CreateControl()
{
Label myFontLabel = new Label();
myFontLabel.Font = new Font("Tahoma", 12, FontStyle.Bold);
myFontLabel.Dock = DockStyle.Fill;
myFontLabel.BackColor = Color.White;
myFontLabel.DoubleClick += myFontLabel_DoubleClick;
return myFontLabel;
}
/// Raises an event when the user double-clicks the label.
private void myFontLabel_DoubleClick(object sender, EventArgs e)
{
int index = 1;
string data = "Raised A Double Click Event";
this.RaiseControlAddInEvent(index, data);
}
}
#endregion
}
I have created the add-in, but the sizing of it does not seem to work. When I apply the ApplySize function to the control, it errors with no information.
When I comment out the ApplySize function, the control load into the client, but size and display are very strange.
Anyone ever attempt this? What am I missing on the Sizing of my control
Control Add-in Source:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Dynamics.Framework.UI.Extensibility;
using Microsoft.Dynamics.Framework.UI.Extensibility.WinForms;
using System.Windows.Forms;
using System.Drawing;
namespace AddInSamples
{
#region "Custom.NAV.FontLabel"
[ControlAddInExport("Custom.NAV.FontLabel")]
public class FontLabelAddin : StringControlAddInBase
{
protected override void OnInitialize()
{
base.OnInitialize();
this.ApplySize(new DisplaySize(101, 600, 1000), new DisplaySize(10, 20, 200));
}
/// Defines the Label control.
protected override Control CreateControl()
{
Label myFontLabel = new Label();
myFontLabel.Font = new Font("Tahoma", 12, FontStyle.Bold);
myFontLabel.Dock = DockStyle.Fill;
myFontLabel.BackColor = Color.White;
myFontLabel.DoubleClick += myFontLabel_DoubleClick;
return myFontLabel;
}
/// Raises an event when the user double-clicks the label.
private void myFontLabel_DoubleClick(object sender, EventArgs e)
{
int index = 1;
string data = "Raised A Double Click Event";
this.RaiseControlAddInEvent(index, data);
}
}
#endregion
}
0
Comments
-
Hi there
I used ApplySize like this and it seems to work:public class MyAddIn: WinFormsControlAddInBase, IObjectControlAddInDefinition { protected override Control CreateControl() { AddInPanel = new Panel(); <... code removed ...> this.ApplySize(new DisplaySize(101, 600, 1000), new DisplaySize(10, 20, 200)); return AddInPanel; } }0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions