frmSprachen

This commit is contained in:
2022-12-05 11:37:02 +01:00
parent 0a3b9bdffd
commit 431c8ca519
2 changed files with 49 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ Partial Class frmSprachen
Me.txttranslate = New System.Windows.Forms.TextBox()
Me.Label7 = New System.Windows.Forms.Label()
Me.txtProgramm = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.btnOK = New System.Windows.Forms.Button()
CType(Me.DataGridView, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
@@ -183,11 +184,22 @@ Partial Class frmSprachen
Me.txtProgramm.TabIndex = 3
Me.txtProgramm.TabStop = False
'
'btnOK
'
Me.btnOK.Location = New System.Drawing.Point(954, 53)
Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(30, 23)
Me.btnOK.TabIndex = 15
Me.btnOK.Text = "OK"
Me.btnOK.UseVisualStyleBackColor = True
Me.btnOK.Visible = False
'
'frmSprachen
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1001, 545)
Me.Controls.Add(Me.btnOK)
Me.Controls.Add(Me.txtProgramm)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label6)
@@ -226,4 +238,5 @@ Partial Class frmSprachen
Friend WithEvents txttranslate As TextBox
Friend WithEvents Label7 As Label
Friend WithEvents txtProgramm As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents btnOK As Button
End Class

View File

@@ -1,4 +1,7 @@
Imports VERAG_PROG_ALLGEMEIN
Imports System.Windows.Controls
Imports GrapeCity.ActiveReports.ReportsCore.Tools
Imports Microsoft.Office.Interop.Word
Imports VERAG_PROG_ALLGEMEIN
Public Class frmSprachen
@@ -6,6 +9,7 @@ Public Class frmSprachen
Public table
Public BIND_DB
Public programId As Integer
Private EditRow As Integer = -1
Sub New(table, BIND_DB, programId)
Me.table = table
Me.BIND_DB = BIND_DB
@@ -26,6 +30,8 @@ Public Class frmSprachen
txtProgramm.fillWithSQL("SELECT [prog_codename] from [tblProgramme] WHERE [prog_id] ='" & programId & "'", "ADMIN")
btnOK.Visible = True
End Sub
@@ -93,6 +99,7 @@ Public Class frmSprachen
End With
Catch ex As Exception
MsgBox(ex.Message)
End Try
@@ -139,10 +146,38 @@ Public Class frmSprachen
e.Row.Cells("trs_progName").Value = txtProgramm.Text
e.Row.Cells("trs_sprache").Value = cbxSprachen._value
e.Row.Cells("trs_active").Value = True
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
If DataGridView.Columns.Count = 0 Or DataGridView.SelectedRows.Count = 0 Then 'alles gelöscht oder markierte Zeile gelöscht
SPRACHENBind.updateBinding()
Exit Sub
End If
If DataGridView.CurrentRow.Cells("trs_object").ToString <> "" AndAlso DataGridView.CurrentRow.Cells("trs_control").ToString <> "" AndAlso DataGridView.CurrentRow.Cells("trs_text").ToString <> "" AndAlso DataGridView.CurrentRow.Cells("trs_textDE").ToString <> "" AndAlso EditRow >= 0 Then
SPRACHENBind.updateBinding()
End If
End Sub
Private Sub DataGridView_EditingControlShowing(sender As Object, e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView.EditingControlShowing
EditRow = DataGridView.CurrentRow.Index
End Sub
Private Sub DataGridView_SelectionChanged(sender As Object, e As EventArgs) Handles DataGridView.SelectionChanged
If EditRow >= 0 Then
Dim new_row As Integer = EditRow
EditRow = -1
DataGridView.CurrentCell = DataGridView.Rows(new_row).Cells(
DataGridView.CurrentCell.ColumnIndex)
End If
End Sub
End Class