Click here to Skip to main content
16,005,149 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionVoice across a network Pin
DH Julio22-May-06 11:34
DH Julio22-May-06 11:34 
QuestionConverting Ascii Hex IEEE Float Pin
Ronny_K22-May-06 10:22
Ronny_K22-May-06 10:22 
AnswerRe: Converting Ascii Hex IEEE Float [modified] Pin
Guffa22-May-06 11:33
Guffa22-May-06 11:33 
AnswerRe: Converting Ascii Hex IEEE Float Pin
Joshua Quick22-May-06 15:20
Joshua Quick22-May-06 15:20 
QuestionCan a timer be started as a thread and execute with KeyDown? Pin
KaKa'22-May-06 5:54
KaKa'22-May-06 5:54 
AnswerRe: Can a timer be started as a thread and execute with KeyDown? Pin
Leeland23-May-06 3:45
Leeland23-May-06 3:45 
Questionruntime shapes Pin
antonaras22-May-06 5:05
antonaras22-May-06 5:05 
QuestionHelp: Control loops & properties in VB .Net 2005 Pin
Sugan V22-May-06 2:46
Sugan V22-May-06 2:46 
Hi all,

I'm using Visual Basic 2005. I would like to loop through the controls
and wite or get some properties based on the controls.

This is the following piece of code in Visual Basic 6.0

For Each ctl In frm.Controls
Set ctl.Font = fnt
sCtlType = TypeName(ctl)
If sCtlType = "Label" Then
ctl.Caption = objLocalizer.GetResourceString(CInt(ctl.Tag))
ElseIf sCtlType = "CommandButton" Then
nVal = 0
nVal = Val(ctl.Tag)

If nVal > 0 Then
ctl.Caption = objLocalizer.GetResourceString(nVal)
End If
Debug.Print objLocalizer.GetResourceString(nVal)
nVal = 0
nVal = Val(ctl.ToolTipText)
If nVal > 0 Then
ctl.ToolTipText = objLocalizer.GetResourceString(nVal)
End If
ElseIf sCtlType = "Menu" Then
ctl.Caption = objLocalizer.GetResourceString(CInt(ctl.Caption))
ElseIf sCtlType = "TabStrip" Then
For Each obj In ctl.Tabs
obj.Caption = objLocalizer.GetResourceString(CInt(obj.Tag))
obj.ToolTipText = objLocalizer.GetResourceString(CInt(obj.ToolTipText))
Next
ElseIf sCtlType = "Toolbar" Then
For Each obj In ctl.Buttons
obj.ToolTipText = objLocalizer.GetResourceString(CInt(obj.ToolTipText))
Next
ElseIf sCtlType = "ListView" Then
For Each obj In ctl.ColumnHeaders
obj.Text = objLocalizer.GetResourceString(CInt(obj.Tag))
Next
ElseIf sCtlType = "ctList" Then
ctl.HeaderFont = fnt
Count = ctl.ColumnCount
For Index = 1 To Count
ctl.ColumnText(Index) = objLocalizer.GetResourceString(CInt(ctl.ColumnText(Index)))
Debug.Print ctl.ColumnText(Index)
Next Index
ElseIf sCtlType = "SSTab" Then
For Index = 0 To ctl.Tabs
ctl.TabCaption(Index) = objLocalizer.GetResourceString(CInt(ctl.TabCaption(Index)))
Next Index
ElseIf sCtlType = "ActiveBar" Then
Dim i As Integer
Dim J As Integer
Dim BandCount As Integer
Dim ToolsCount As Integer
BandCount = ctl.Bands.Count
For i = 0 To BandCount
ToolsCount = ctl.Bands(Index).Tools.Count
For J = 0 To ToolsCount
nVal = 0
nVal = Val(ctl.Bands(i).Tools(J).Tag)
If nVal > 0 Then
ctl.Bands(i).Tools(J).Caption = objLocalizer.GetResourceString(nVal)
End If
nVal = 0
nVal = Val(ctl.Bands(i).Tools(J).ToolTipText)
If nVal > 0 Then
ctl.Bands(i).Tools(J).ToolTipText = objLocalizer.GetResourceString(nVal)
End If
Next J
Next i
Else
nVal = 0
nVal = Val(ctl.Tag)
If nVal > 0 Then ctl.Caption = objLocalizer.GetResourceString(nVal)
nVal = 0
nVal = Val(ctl.ToolTipText)
If nVal > 0 Then ctl.ToolTipText = objLocalizer.GetResourceString(nVal)
End If
Next



When the same code is to be converted to Visual Basic 2005, i would
like to know how to access
1. ctl.HeaderFont in case of "ctList"
2. ctl.ColumnCount in case of "ctList"
3. ctl.ColumnText(Index) in case of "ctList"
4. ctl.Tabs in case of ctl is a SSTab
5. ctl.TabCaption(Index) in case of a Tab in SSTab

Any Help in this regard would be appreciated


Thanks in advance,

Sugan
Chennai
AnswerRe: Help: Control loops & properties in VB .Net 2005 [modified] Pin
sathish s22-May-06 3:30
sathish s22-May-06 3:30 
QuestionCreate formatting toolbar Pin
thangkhonnan22-May-06 1:53
thangkhonnan22-May-06 1:53 
Questionwhat is assembly ?? Pin
Mohammed Amine22-May-06 1:40
Mohammed Amine22-May-06 1:40 
AnswerRe: what is assembly ?? Pin
Joshua Quick22-May-06 7:21
Joshua Quick22-May-06 7:21 
GeneralRe: what is assembly ?? Pin
Mohammed Amine22-May-06 11:17
Mohammed Amine22-May-06 11:17 
Questionhow to fill the Form1's controls From Form2's ones ? Pin
Mohammed Amine22-May-06 1:32
Mohammed Amine22-May-06 1:32 
AnswerRe: how to fill the Form1's controls From Form2's ones ? Pin
Joshua Quick22-May-06 7:42
Joshua Quick22-May-06 7:42 
QuestionHOWTO: make child controls scroll inside a container? Pin
batmike200021-May-06 23:54
batmike200021-May-06 23:54 
Questioncombobox selecteditem [modified] Pin
amilapradeep21-May-06 23:51
amilapradeep21-May-06 23:51 
QuestionHow to show the form in this case? Pin
cylix200021-May-06 23:35
cylix200021-May-06 23:35 
AnswerRe: How to show the form in this case? Pin
batmike200021-May-06 23:59
batmike200021-May-06 23:59 
Questioncode for delete Pin
SwatiPathania21-May-06 22:50
SwatiPathania21-May-06 22:50 
GeneralRe: code for delete Pin
_AK_22-May-06 1:14
_AK_22-May-06 1:14 
AnswerRe: code for delete Pin
Mohammed Amine22-May-06 1:23
Mohammed Amine22-May-06 1:23 
GeneralRe: code for delete Pin
Colin Angus Mackay22-May-06 1:37
Colin Angus Mackay22-May-06 1:37 
GeneralRe: code for delete Pin
Mohammed Amine22-May-06 1:49
Mohammed Amine22-May-06 1:49 
GeneralRe: code for delete Pin
Colin Angus Mackay22-May-06 1:57
Colin Angus Mackay22-May-06 1:57 

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.