/// <summary>
        /// Sets the properties of the labels based upon user input
        /// </summary>
        private void UpdateLabels()
        {
            MapWinGIS.Labels lb = _shapefile.Labels;
            lb.Visible = chkShowLabels.Checked;

            // categories will have the same alignment
            for (int i = 0; i < _shapefile.Labels.NumCategories; i++)
            {
                MapWinGIS.LabelCategory cat = _shapefile.Labels.get_Category(i);
                cat.Alignment = lb.Alignment;
                cat.OffsetX   = lb.OffsetX;
                cat.OffsetY   = lb.OffsetY;
            }

            DrawLabelsPreview();
        }
        /// <summary>
        /// Changing the default style of labels
        /// </summary>
        private void btnLabelsAppearance_Click(object sender, EventArgs e)
        {
            LabelStyleForm styleFormForm = new LabelStyleForm(_legend, _shapefile, _layerHandle);

            styleFormForm.ShowDialog();

            // updating controls (even if cancel was hit, a user could have applied the options)
            MapWinGIS.LabelCategory options = _shapefile.Labels.Options;
            udLabelFontSize.Value = options.FontSize;
            clpLabelFrame.Color   = Colors.UintToColor(options.FrameBackColor);
            chkLabelFrame.Checked = options.FrameVisible;
            chkShowLabels.Checked = options.Visible;

            RefreshControlsState(null, null);

            RedrawMap();

            // refreshing preview
            DrawLabelsPreview();

            styleFormForm.Dispose();
        }
        /// <summary>
        /// Initializes new instance of the FontGradientForm class
        /// </summary>
        /// <param name="labels">To set parameters for</param>
        public FontGradientForm(MapWinGIS.LabelCategory labels, bool fontGradient)
        {
            InitializeComponent();

            _fontGradient = fontGradient;
            _labels       = labels;

            _noEvents = true;
            icbFontGradient.ComboStyle    = ImageComboStyle.LinearGradient;
            icbFontGradient.SelectedIndex = 0;

            if (fontGradient)
            {
                this.Text = "Font gradient";
            }
            else
            {
                this.Text = "Frame gradient";
            }
            _noEvents = false;

            Settings2GUI();
        }