From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Check Box in a SUD table

Hello, I am trying to use a matrix of Check Boxes in a SUD and I ask myself if it is possible to change a property of the table object to make that the cells appear like one check box and later obtain its true or false value using the value property. Is this possible?

0 Kudos
Message 1 of 11
(4,075 Views)
Hi ingluisef...,
 
Could you please describe in more detail what you want-- I am having a hard time imagining what you mean from what you've already written.
 
Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 2 of 11
(4,055 Views)

Hello, Brad.

I am making some measurements that I want to compare in a set of graphics. Each measurement consist in a file with sixteen channels. I want to put the name of the channels in the first column and the name of the file in  the first row of the matrix. In order to get the desired graph, the "user" of the dialog only needs to select the channel of the desired files that he wants to print in a report. It is as easy as put a "1" or a "0" in the appropiate cell, but it should be more aesthetic and friendly to have check boxes. I was thinking in a table similar to the Data Window of Diadem, but with several check box columns.

0 Kudos
Message 3 of 11
(4,030 Views)

Hi,

I created a table (called "MyTable") in a SUD dialog and in the "OnSelChange" sub, I have this:

If MyTable.SelectedCells(1).Column = 1 Then
  If MyTable.SelectedCells(1).Value <> "X" Then
    MyTable.SelectedCells(1).Value = "X"
  Else
   MyTable.SelectedCells(1).Value = ""
  End If
End If 

 

 

0 Kudos
Message 4 of 11
(4,027 Views)

Hi,

I created a table (called "MyTable") in a SUD dialog and in the "OnSelChange" sub, I have this:

If MyTable.SelectedCells(1).Column = 1 Then
  If MyTable.SelectedCells(1).Value <> "X" Then
     MyTable.SelectedCells(1).Value = "X"
  Else
   MyTable.SelectedCells(1).Value = ""
  End If
End If 

 

 

0 Kudos
Message 5 of 11
(4,027 Views)

Hi,

I created a table (called "MyTable") in a SUD dialog and in the "OnSelChange" sub, I have this:

If MyTable.SelectedCells(1).Column = 1 Then
  If MyTable.SelectedCells(1).Value <> "X" Then
      MyTable.SelectedCells(1).Value = "X"
  Else
   MyTable.SelectedCells(1).Value = ""
  End If
End If 

 

 

0 Kudos
Message 6 of 11
(4,021 Views)

Hi,

I created a table (called "MyTable") in a SUD dialog and in the "OnSelChange" sub, I have this:

If MyTable.SelectedCells(1).Column = 1 Then
  If MyTable.SelectedCells(1).Value <> "X" Then
       MyTable.SelectedCells(1).Value = "X"
  Else
   MyTable.SelectedCells(1).Value = ""
  End If
End If 

 

 

0 Kudos
Message 7 of 11
(4,021 Views)

Hi,

I created a table (called "MyTable") in a SUD dialog and in the "OnSelChange" sub, I have this:

If MyTable.SelectedCells(1).Column = 1 Then
  If MyTable.SelectedCells(1).Value <> "X" Then
        MyTable.SelectedCells(1).Value = "X"
  Else
   MyTable.SelectedCells(1).Value = ""
  End If
End If 

 

 

0 Kudos
Message 8 of 11
(4,026 Views)

Wow, very sorry about that! I pushed the space bar and suddenly I posted many times!  This is what I was going to say:

I'm not sure if this is exactly what you want, but here is something I tried:
I created a table (called "MyTable") in a SUD dialog.  In the "OnSelChange" subroutine, I have:

Sub MyTable_OnSelChange()
Dim This : Set This = MyTable

If MyTable.SelectedCells(1).Column = 1 Then
  If MyTable.SelectedCells(1).Value <> "X" Then
   MyTable.SelectedCells(1).Value = "X"
  Else
   MyTable.SelectedCells(1).Value = ""
  End If
End If 

End Sub

(you will not need the first two or last line).  What this does is put an "X" in the first column when the user clicks on it, and then takes it away with the next click.  So I'm not sure if this will be helpful or not, but I thought I would mention it.

 

Julia

0 Kudos
Message 9 of 11
(4,027 Views)

Thank you very much, Julia. As a matter of fact, to put "X"s (to use the keyboard) is what I am trying to avoid. I made something near to what I am trying to do with a table, but with an array of check boxes using the set function at the general declarations; something like this:

Dim ArrayCheckBoxes(16) ' For example

Set ArrayCheckBoxes(1)=CheckBox1

Set ArrayCheckBoxes(2)=CheckBox2

...

And so on. It was useful, but from my point of view impractical, because the code for process the information is not so concise and that what's I was looking for something better.

I really appreciate your help, and I hope you can find useful my method for your application.

Greetings from Mexico.

0 Kudos
Message 10 of 11
(4,015 Views)