Click here to Skip to main content
15,919,607 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: How to make a setup file that detects/installs .NET framework? Pin
Paul Riley14-Mar-03 7:50
Paul Riley14-Mar-03 7:50 
GeneralDatabinding : control synchronization Pin
EPO10-Mar-03 6:45
EPO10-Mar-03 6:45 
Generalglobal exception handler Pin
Chris Richner9-Mar-03 11:05
Chris Richner9-Mar-03 11:05 
GeneralParsing ASP pages with Regex object Pin
Frank Liao7-Mar-03 10:18
Frank Liao7-Mar-03 10:18 
GeneralGetProperty + overriden Property -> AmbiguousMatchException Pin
Julio Martínez6-Mar-03 7:22
Julio Martínez6-Mar-03 7:22 
Questionhow to configure an applicaiton in .net Pin
waleed riaz5-Mar-03 22:29
waleed riaz5-Mar-03 22:29 
AnswerRe: how to configure an applicaiton in .net Pin
Stephane Rodriguez.10-Mar-03 21:58
Stephane Rodriguez.10-Mar-03 21:58 
GeneralError while putting usercontrol on tabcontrol Pin
nguyentuancuong5-Mar-03 14:06
nguyentuancuong5-Mar-03 14:06 
i was developed usercontrol inherits TextBox control, when i put it on form is ok (in design mode), but when i put it on tabcontrol and switching between code window and design window show following error message:
- An error occured while loading the document. Fix the error, and then try loading document again.
The varible 'control name' is either undeclared or was never assigned
...

but i press F5 it run

thanks

cuong,



Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Drawing

<defaultproperty("mandatorry")> Public Class VPIDSTextBox
Inherits TextBox

Private _mandatory As Boolean
Private _tagData As Boolean
Private _enterFocusColor As Color = Color.FromArgb(200, 210, 215)
Private _leaveFocusColor As Color = Color.FromArgb(0, 0, 0)
Private _fieldName As String
Private _dataType As Int16 ' 0: Text; 1: Number ; 2: Date
Private _dataFormat As String
Private _keep As Boolean
Private _isSaveData As Boolean = True
Private _showButton As Boolean = False

Public WithEvents ErrPro As System.Windows.Forms.ErrorProvider
'Public WithEvents cmdButton As Button
'Event ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs)

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call
'init error provider
ErrPro = New System.Windows.Forms.ErrorProvider()

End Sub

'UserControl overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
'
'VPIDSTextBox
'
End Sub

#End Region

<description("determine must="" be="" save="" or="" not"),="" _
="" category("behavior"),="" defaultvalue(true)=""> _
Property IsSaveData() As Boolean
Get
Return _isSaveData
End Get
Set(ByVal Value As Boolean)
_isSaveData = Value
End Set
End Property

<description("define button="" is="" visible="" or="" not"),="" _
="" category("behavior")=""> _
Property ShowButton() As Boolean
Get
Return _showButton
End Get
Set(ByVal Value As Boolean)
_showButton = Value

'If _showButton Then
' If Not Me Is Nothing Then
' cmdButton = New Button()
' Me.Controls.Add(cmdButton)
' cmdButton.Text = "..."
' cmdButton.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
' cmdButton.Dock = DockStyle.Right
' cmdButton.BackColor = System.Drawing.SystemColors.Control
' cmdButton.Width = 20
' AddHandler cmdButton.Click, AddressOf myButtonClick
' cmdButton.Visible = True
' End If
'End If
End Set
End Property

<description("use to="" format="" data="" when="" control="" lost="" focus"),="" _
="" category("behavior")=""> _
Property DataFormat() As String
Get
Return _dataFormat
End Get
Set(ByVal Value As String)
_dataFormat = Value
End Set
End Property

<description("determine to="" clear="" data="" or="" not="" when="" method="" all="" fired"),="" _
="" category("behavior")=""> _
Property Keep() As Boolean
Get
Return _keep
End Get
Set(ByVal Value As Boolean)
_keep = Value
End Set
End Property

<description("indicates whether="" the="" control="" can="" be="" left="" blank"),="" _
="" category("behavior"),="" defaultvalue(false)=""> _
Property Mandatory() As Boolean
Get
Mandatory = _mandatory
End Get
Set(ByVal Value As Boolean)
_mandatory = Value
End Set
End Property

<description("the field="" name="" use="" for="" insert="" or="" update="" data="" form"),="" _
="" category("behavior")=""> _
Property FieldName() As String
Get
Return _fieldName
End Get
Set(ByVal Value As String)
_fieldName = Value
End Set
End Property

<description("the data="" type="" use="" for="" insert="" or="" update="" form="" (0:="" text;="" 1:="" number="" ;="" 2:="" date)"),="" _
="" category("behavior"),="" defaultvalue(0)=""> _
Property DataType() As Int16
Get
Return _dataType
End Get
Set(ByVal Value As Int16)
_dataType = Value
End Set
End Property

<description("define where="" to="" get="" data="" for="" insert="" or="" update="" form"),="" _
="" category("behavior"),="" defaultvalue(false)=""> _
Property TagData() As Boolean
Get
Return _tagData
End Get
Set(ByVal Value As Boolean)
_tagData = Value
End Set
End Property

<description("the color="" of="" the="" control="" when="" it="" receives="" focus"),="" _
="" category("appearance")=""> _
Property EnterFocusColor() As Color
Get
EnterFocusColor = _enterFocusColor
End Get
Set(ByVal Value As Color)
_enterFocusColor = Value
End Set
End Property

<description("the color="" of="" the="" control="" when="" it="" looses="" focus"),="" _
="" category("appearance")=""> _
Property LeaveFocusColor() As Color
Get
LeaveFocusColor = _leaveFocusColor
End Get
Set(ByVal Value As Color)
_leaveFocusColor = Value
End Set
End Property

Private Sub VPIDSTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Enter

Me.BackColor = _enterFocusColor
If DataType = 2 Then ' date
Me.SelectAll()
End If

End Sub

Private Sub VPIDSTextBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Leave
Me.BackColor = _leaveFocusColor
If RaiseInputError() Then Exit Sub

Dim du As New ERPCore.DataUltilities()
If (Not du.IsEmptyString(_dataFormat)) And (Not du.IsEmptyString(Me.Text)) Then
Dim y As String = Year(Now()).ToString()
Dim strMess As String = "Bạn phải nhập dữ liệu kiểu Date/ This field data type is Date"
Select Case _dataType
Case 1 ' Numberic
Try
Me.Text = Format(CDbl(Me.Text), _dataFormat)
Catch ex As Exception
ErrPro.SetError(Me, "Bạn phải nhập dữ liệu kiểu số vào trường này/Wrong data type, you must enter data type is Numberic")
Exit Sub
End Try
ErrPro.SetError(Me, "")

Case 2 'Date
If (Me.Text.Length = 4) Or (Me.Text.Length = 6) Or (Me.Text.Length = 8) Or (Me.Text.Length = 10) Then
Select Case Me.Text.Length
Case 4
Me.Text = Me.Text.Insert(2, "/")
Me.Text = Me.Text.Insert(5, "/")
Me.Text = Me.Text.Insert(6, y)
Case 6
Me.Text = Me.Text.Insert(2, "/")
Me.Text = Me.Text.Insert(5, "/")
Me.Text = Me.Text.Insert(6, y.Substring(0, 2))
Case 8
Me.Text = Me.Text.Insert(2, "/")
Me.Text = Me.Text.Insert(5, "/")
End Select
Else
ErrPro.SetError(Me, strMess)
End If
If Not Len(VietDateToUSDate(Me.Text)) > 0 Then
ErrPro.SetError(Me, strMess)
Else
ErrPro.SetError(Me, "")
End If
End Select
End If

End Sub

Public Function RaiseInputError() As Boolean

If (_mandatory = True) And (Len(Me.Text) = 0) Then
ErrPro.SetError(Me, "Bạn phải nhập thông tin vào trường này / You must Enter data into this field")
Me.Focus()
Return True
Else
ErrPro.SetError(Me, "")
Return False
End If

End Function


Private Function VietDateToUSDate(ByVal strVietDate As String) As String
Dim strUSDate As String
Dim arr() As String = Split(strVietDate, "/")
If arr.Length = 3 Then
strUSDate = arr(1) & "/" & arr(0) & "/" & arr(2)
Try
If (0 < CInt(arr(1)) < 13) And (0 < CInt(arr(0)) < 32) Then
Return strUSDate
Else
Return ""
End If
Catch ex As Exception
Return ""
End Try
Else
Return ""
End If
End Function

'Public Sub myButtonClick(ByVal sender As Object, ByVal e As EventArgs)
' RaiseEvent ButtonClick(sender, e)
' Me.Focus()
'End Sub


'Protected Overrides Sub OnLeave(ByVal e As System.EventArgs)
' If Me.ShowButton Then
' System.Windows.Forms.SendKeys.Send("{TAB}")
' End If
'End Sub

End Class
GeneralDebug or Release Pin
Pierre-Yves Troel4-Mar-03 7:37
Pierre-Yves Troel4-Mar-03 7:37 
GeneralRe: Debug or Release Pin
Stephane Rodriguez.4-Mar-03 11:29
Stephane Rodriguez.4-Mar-03 11:29 
GeneralRe: Debug or Release Pin
Pierre Yves Troel4-Mar-03 17:05
sussPierre Yves Troel4-Mar-03 17:05 
GeneralRe: Debug or Release Pin
Stephane Rodriguez.5-Mar-03 5:29
Stephane Rodriguez.5-Mar-03 5:29 
GeneralLicensed Controls on Web Pages Pin
NigelSavidge4-Mar-03 4:53
NigelSavidge4-Mar-03 4:53 
GeneralPlease Heeelp - ShouldSerializeMyProperty problem Pin
Uriel Cohen4-Mar-03 3:01
Uriel Cohen4-Mar-03 3:01 
GeneralRe: Please Heeelp - ShouldSerializeMyProperty problem Pin
Bo Hunter16-Mar-03 17:05
Bo Hunter16-Mar-03 17:05 
GeneralRe: Please Heeelp - ShouldSerializeMyProperty problem Pin
Uriel16-Mar-03 18:14
Uriel16-Mar-03 18:14 
QuestionWhich .NET developer magazine? Pin
Oyvind Bratland4-Mar-03 2:24
Oyvind Bratland4-Mar-03 2:24 
GeneralWhere to get the COM+ Current Object Count Pin
Gaul3-Mar-03 9:23
Gaul3-Mar-03 9:23 
GeneralHelp: Unable To Copy Data (In Structure) from Unmanged MFC/C++ App to .NET Pin
Gaul3-Mar-03 9:05
Gaul3-Mar-03 9:05 
QuestionSystem.Drawing.Drawing3D? Pin
Ioncycle3-Mar-03 5:30
Ioncycle3-Mar-03 5:30 
AnswerRe: System.Drawing.Drawing3D? Pin
leppie3-Mar-03 8:59
leppie3-Mar-03 8:59 
GeneralRe: System.Drawing.Drawing3D? Pin
Ioncycle21-Mar-03 11:56
Ioncycle21-Mar-03 11:56 
GeneralInterop - Marshaling nested structs Pin
Nathan Tran2-Mar-03 19:03
Nathan Tran2-Mar-03 19:03 
GeneralRemoting over internet (events) Pin
Richard P S2-Mar-03 9:24
Richard P S2-Mar-03 9:24 
GeneralRe: Remoting over internet (events) Pin
John Davis2-Mar-03 10:48
John Davis2-Mar-03 10:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.