VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} DummyDocDlg 
   Caption         =   "Параметры документа-заглушки"
   ClientHeight    =   1230
   ClientLeft      =   120
   ClientTop       =   465
   ClientWidth     =   5895
   OleObjectBlob   =   "DummyDocDlg.frx":0000
   StartUpPosition =   1  'CenterOwner
End
Attribute VB_Name = "DummyDocDlg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public isCancelled_ As Boolean

Private Sub UserForm_Initialize()
  isCancelled_ = True
  
  Call cbDocType.AddItem("01. Не определен")
  Call cbDocType.AddItem("02. Международное законодательство")
  Call cbDocType.AddItem("03. Конституция")
  Call cbDocType.AddItem("04. Федеральный конституционный закон")
  Call cbDocType.AddItem("05. Кодекс")
  Call cbDocType.AddItem("06. Президент")
  Call cbDocType.AddItem("07. Федеральный закон")
  Call cbDocType.AddItem("08. Правительство")
  Call cbDocType.AddItem("09. Верховный суд")
  Call cbDocType.AddItem("10. Генеральная прокуратура")
  Call cbDocType.AddItem("11. Министерство")
  Call cbDocType.AddItem("12. Агентство, служба, ведомство")
  
  tbType.Value = 1
End Sub

Public Function GetType() As TLawType
  GetType = cbDocType.ListIndex + 1
End Function

' =======
Private Sub tbType_Change()
  Dim txt$: txt = tbType.Text
  If Not IsNumeric(txt) Then _
    Exit Sub
  Dim val&: val = CLng(txt)
  If val < 1 Or val > cbDocType.ListCount Then _
    Exit Sub
  cbDocType.ListIndex = val - 1
End Sub

Private Sub cbDocType_Change()
  tbType.Value = cbDocType.ListIndex + 1
End Sub

Private Sub cmdGo_Click()
  isCancelled_ = False
  Call Me.Hide
End Sub

Private Sub cmdCancel_Click()
  isCancelled_ = True
  Call Me.Hide
End Sub
