Regarding the issue of using WPF to display CAD tabs.

Regarding the issue of using WPF to display CAD tabs.

RainBow″
Contributor Contributor
331 Views
3 Replies
Message 1 of 4

Regarding the issue of using WPF to display CAD tabs.

RainBow″
Contributor
Contributor

I want to display the content of color, line type, and line width tabs in CAD through WPF, but I only found the display method of color tabs and did not find the display method of line type and line width.Is there a way to solve it?

I tried these three attributes and didn't find any effect. Here is my Shaml code. In addition, I also tried LinetypeDialog, which does not inherit System.Windows.Controls.Control interface, therefore it cannot be embedded into my Xaml code.

 

@dali0312 This brother also raised the same question, but did not receive an effective solution

 

<Window x:Class="Class1.Form.ZTestForm"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Class1.Form"
             xmlns:windows="clr-namespace:Autodesk.AutoCAD.Windows;assembly=AcWindows"
             mc:Ignorable="d" Loaded="Window_Loaded"
             d:DesignHeight="450" d:DesignWidth="800">

    <StackPanel>
        <DockPanel>
            <windows:ColorComboBox Name="colorcom" Width="120" Height="38" />
        </DockPanel>    
    </StackPanel> 
</Window>




 /// <summary>
    /// ZTest.xaml 的交互逻辑
    /// </summary>
    public partial class TestForm : Window
    {
        public TestForm()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            colorcom.BorderBrush = Brushes.White;
            colorcom.Background = Brushes.White;
            colorcom.Foreground = Brushes.White;

        } 
    }

 

0 Likes
332 Views
3 Replies
Replies (3)
Message 2 of 4

dali0312
Contributor
Contributor

Give you a thumbs up!

0 Likes
Message 3 of 4

dali0312
Contributor
Contributor

Why hasn't anyone replied to you?

0 Likes
Message 4 of 4

essam-salah
Advisor
Advisor

hi

Colors/Linetype dialogs already built in in .net api, check the next pic and code:

      var acadDialog = new Autodesk.AutoCAD.Windows.ColorDialog();
      var dialogResult = acadDialog.ShowDialog();
      if (dialogResult == System.Windows.Forms.DialogResult.OK)
      {
        // to do
       acadDialog.Color
      }

 

 

essamsalah_0-1741709238518.png

 

0 Likes