Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在VB6中限制添加重复项_Vb6_Activereports_Componentone - Fatal编程技术网

如何在VB6中限制添加重复项

如何在VB6中限制添加重复项,vb6,activereports,componentone,Vb6,Activereports,Componentone,我有一个用VB6编写的应用程序 此应用程序包含一个包含foreach循环的代码段的文件。在这个循环中,有一个方法将控件添加到报告中的某个区域 我正在尝试实现以下功能: 当Header添加到headerSection中时,tt将不会再次添加Header,但是此代码段无法执行此操作。我哪里做错了 For Each thisColumn As Column In theColumns If thisColumn.Type = Column.ColumnType.Description Then

我有一个用VB6编写的应用程序

此应用程序包含一个包含foreach循环的代码段的文件。在这个循环中,有一个方法将控件添加到报告中的某个区域

我正在尝试实现以下功能:

当Header添加到headerSection中时,tt将不会再次添加Header,但是此代码段无法执行此操作。我哪里做错了

For Each thisColumn As Column In theColumns
  If thisColumn.Type = Column.ColumnType.Description Then
     AddDescriptionColumn(thisColumn, startColumnAt, headerTop)
  End If
 Private Sub AddDescriptionColumn(ByVal ColumnToAdd As Column, ByRef LeftPosition As Single, ByVal HeaderTop As Single)

  'Get report sections
  Dim headerSection As ActiveReports.Section = _theActiveReport.Sections(PageHeaderName)

  'Add column header text
  Dim theHeader As New ActiveReports.Label
  theHeader.Name = "lblDescription"
  theHeader.Text = ColumnToAdd.DisplayCaption
  theHeader.Font = ColumnToAdd.HeaderFont
  theHeader.Location = New PointF(LeftPosition, HeaderTop)
  theHeader.Size = New SizeF(columnWidth, _columnHeaderHeight)
  If TextHeight(ColumnToAdd.DisplayCaption, theHeader.Font, columnWidth) > _columnHeaderHeight Then
     theHeader.VerticalAlignment = ActiveReports.VerticalTextAlignment.Top
  Else
     theHeader.VerticalAlignment = ActiveReports.VerticalTextAlignment.Bottom
  End If
  theHeader.BackColor = Color.Transparent
  theHeader.MultiLine = True
  theHeader.WordWrap = True
  theHeader.Visible = True
  headerSection.Controls.Add(theHeader)

Dim headerSection As ActiveReports.Section=\u ActivierReport.SectionsPageHeaderName是无效的VB6语法。这是VB.Net源代码吗?这是VB.Net代码而不是VB6代码。SizeF、PointF是.Net类型。对于每个this列,列中的列是VB.Net,在VB6中用作内部ForEach是不合法的。正如wqw所说,在VB6中初始化Dim行上的变量是不合法的