|
I think it is wrong! When you remove a tabpage from the collection. It removes everything in the tabpage, you won't able to put them back. When you add it to collection later, it shows an empty tab page...
|
|
|
|
|
You need to Remove the TabPage in your code to make this work, not through the form editor.
First create the TabPage in your form editor like you did before.
Next, in your form code you would Remove the TabPage from the TabControl's TabPage collection like this.
myTabControl.TabPages.Remove(myTabPage)
Trust me, this works. You can re-add the page to the TabControl like this.
myTabControl.TabPages.Add(myTabPage)
|
|
|
|
|
I'm using the following VB.Net code to retreive the field names of a table in an Access db:
Dim NewField As ADOX.Column
Dim tblField As ADOX.Column
For Each tblField In adocat.Tables("tblData").Columns
The fields are returned in alphabetical order! I want to have the fields returned in the order they were created. Can this be done?
|
+-- JDMils
|
+--VB6
+--VB Dot Net
|
|
|
|
|
|
There is no escape from the loop, so it surely will hang your program. You have to add a condition for when the loop should end.
---
b { font-weight: normal; }
|
|
|
|
|
thanks, but now i have another error on the path which value cannot be null.When i havent put into the loop it works.. but after put it in.. it said the path is null.. any idea wat happen to it?
For x = 1 To Val(ComboBox1.Text)
'to compare the other player,no need compare to itself
' y = pi(c).Text 'current player selection
i = pi(x).Text 'other player selection
If c <> x Then
If y = i Then
Do
'Randomly pick number from 1 to 7
Randomize(bc)
y = (Int(Rnd() * 7) + 1)
pi(c).Text = y
tokenform.token.Text = y
If y = 1 Then
imagetoken = (Path.GetDirectoryName(Application.ExecutablePath) & "\tokenimage\1egg.gif")
ElseIf y = 2 Then
imagetoken = (Path.GetDirectoryName(Application.ExecutablePath) & "\tokenimage\2egg.gif")
ElseIf y = 3 Then
imagetoken = (Path.GetDirectoryName(Application.ExecutablePath) & "\tokenimage\3egg.gif")
ElseIf y = 4 Then
imagetoken = (Path.GetDirectoryName(Application.ExecutablePath) & "\tokenimage\4egg.gif")
ElseIf y = 5 Then
imagetoken = (Path.GetDirectoryName(Application.ExecutablePath) & "\tokenimage\5egg.gif")
ElseIf y = 6 Then
imagetoken = (Path.GetDirectoryName(Application.ExecutablePath) & "\tokenimage\6egg.gif")
ElseIf y = 7 Then
imagetoken = (Path.GetDirectoryName(Application.ExecutablePath) & "\tokenimage\7egg.gif")
End If
Loop Until y <> i
End If
End If
Next
|
|
|
|
|
That is because you only set the path if you had to pick a random number.
---
b { font-weight: normal; }
|
|
|
|
|
actually i was trying to make the image keep on changing so it loop like randomly chossing picture.... i try to move that if..else statement after the loop but same error...
|
|
|
|
|
What does the code look like where you get the error, then?
---
b { font-weight: normal; }
|
|
|
|
|
oh is ok now~ i place if after the if statement from the loop
|
|
|
|
|
how i can call sql server 2000 from my application by network (application client)(sql server 2000 on other pc)
Sqlconnection.connectionstring="?!"
123
|
|
|
|
|
|
Hello Everybody,
i recently create a new dataentry project in vb.net and i want use ms-access 2000 as a backend. how can Insert, Update, Delete the record in vb.net using Access-2000?
plz. Help me.
Thanks a lot more in advance!!!
with regards
sudhir
|
|
|
|
|
First, you need to read up on ADO.NET[^]. It's important for you to know how to use this library's classes before you can continue.
You'll need to use the OleDB classes to connect to an Access database.
|
|
|
|
|
Thanks a lot. i successfully write my code.
see you later, take care!
|
|
|
|
|
ok this is starting to drive me insane . I know its realy simple but for the life of me i cannot figure out how to do it.
This is my code.
<br />
Public Class dpGenerals<br />
Inherits System.Collections.CollectionBase<br />
<br />
Private m_oSections As Sections<br />
<br />
Public ReadOnly Property Section(ByVal Index As Integer) As Section<br />
Get<br />
Return DirectCast(List(Index), Section)<br />
End Get<br />
End Property<br />
<br />
Public Function Add(ByVal key As Integer, ByVal value As String, ByVal sec As String) As Boolean<br />
Try<br />
Dim oSection As New Section<br />
oSection.key = key<br />
oSection.value = value<br />
oSection.sec = sec<br />
List.Add(oSection)<br />
Return True<br />
Catch E As Exception<br />
Return False<br />
End Try<br />
End Function<br />
<br />
Public Function Add(ByVal oSection As Section) As Boolean<br />
Try<br />
List.Add(oSection)<br />
Return True<br />
Catch E As Exception<br />
Return False<br />
End Try<br />
End Function<br />
<br />
End Class<br />
<br />
<br />
<br />
Public Class Sections<br />
Inherits System.Collections.CollectionBase<br />
Private m_oSections As Sections<br />
Private m_key As Integer<br />
<br />
'Default<br />
Public ReadOnly Property Sections(ByVal Index As Integer) As Section<br />
Get<br />
Return DirectCast(List(Index), Section)<br />
End Get<br />
End Property<br />
<br />
Public ReadOnly Property Keys(ByVal Index As Integer) As key<br />
Get<br />
Return DirectCast(List(Index), key)<br />
End Get<br />
End Property<br />
<br />
Public Function Addbla(ByVal key As Integer, ByVal value As String, ByVal sec As String) As Boolean<br />
Try<br />
Dim oSection As New Section<br />
oSection.key = key<br />
oSection.value = value<br />
oSection.sec = sec<br />
List.Add(oSection)<br />
Return True<br />
Catch E As Exception<br />
Return False<br />
End Try<br />
End Function<br />
<br />
End Class<br />
<br />
<br />
Public Class Section<br />
Private m_sec As String<br />
Private m_type As Integer<br />
Private m_key As Integer<br />
Private m_value As String<br />
<br />
Private m_keys As Keys<br />
Private m_sections As Sections<br />
<br />
Public Sub New()<br />
MyBase.New()<br />
m_keys = New keys()<br />
End Sub<br />
<br />
Public Property sec() As String<br />
Get<br />
Return m_sec<br />
End Get<br />
Set(ByVal value As String)<br />
m_sec = value<br />
End Set<br />
End Property<br />
Public Property type() As Integer<br />
Get<br />
Return m_type<br />
End Get<br />
Set(ByVal value As Integer)<br />
m_type = value<br />
End Set<br />
End Property<br />
Public Property key() As Integer<br />
Get<br />
Return m_key<br />
End Get<br />
Set(ByVal value As Integer)<br />
m_key = value<br />
End Set<br />
End Property<br />
Public Property value() As String<br />
Get<br />
Return m_value<br />
End Get<br />
Set(ByVal Value As String)<br />
m_value = Value<br />
End Set<br />
End Property<br />
<br />
Public ReadOnly Property Keys() As keys<br />
Get<br />
Return m_keys<br />
End Get<br />
End Property<br />
Public ReadOnly Property Sections() As Sections<br />
Get<br />
Return m_sections<br />
End Get<br />
End Property<br />
<br />
End Class<br />
<br />
<br />
<br />
<br />
Module Modtest<br />
Public dparmor As New dpGenerals<br />
Public Sub Test()<br />
dparmor.Add(4, "light", "armor")<br />
dparmor.Add(2, "heavy", "armor")<br />
<br />
dparmor.Section.Addbla(1, "SUB!1", "armobSuB")<br />
'dparmor.Add.Addbla(1, "SUB!1", "armobSuB")<br />
<br />
MsgBox(dparmor.Section(0).key)<br />
End Sub<br />
End Module<br />
All i am trying to do is have a few nested collections :/.
Aparmor.add() allows me to add a section
but for the life of me i cant get the addbla() to add a sub section.
I would like many levels deep dparmor.section(0).section(0).section(0).key
i would also like many levels of keys
ie dparmor.section(0).keys(0).key
dparmor.section(0).section(0).key
Please i know its probably so simple but i just cant figure it out, i do know that sections is the collection of a type section and that the addbla is under sections and not section. but i dont know how to go about fixing this. As you can see there are a few more properites but i think if i can just get that part working the rest will fall into place.
Please any help with this is greatly appreciated.
Thanks
|
|
|
|
|
You are adding everyting into the same list, and you don't even create that list anywhere, you just use it out of the blue...
---
b { font-weight: normal; }
|
|
|
|
|
i didnt think i needed to add that code as well
Public dparmor As new dpGenerals
will thats the line there ... then ie
dparmor.section(0).keys(0).key<br />
dparmor.section(0).section(0).key<br />
dparmor.section(0).section(0).section(0).key
but i cant get the add to work as mentioned above, the adding of a section works cus it Class dpGenerals (add). But the property dpGenerals.Section is a collection of the type section, so i cant call the dparmor.section.addbla(). I just dont know how to convert the code to be able to call that fucntion addbla. I dunno if that makes it any clearer ?
-- modified at 5:50 Saturday 11th March, 2006
i just figured it out ... made 2 changes and works now :/
|
|
|
|
|
But you did show that code already, but that's not the collection you are adding the values to. I'm talking about the collection named List that you are using in the code.
---
b { font-weight: normal; }
|
|
|
|
|
recently i posted a question as follows
---------------------------------------
i am using toolbar component .net ver 2 (not toolstrip) in vb.net 2005.
if i give application.enablevisualstyle command to enable xp style interface
then icons on my toolbar will not come. if i disabel xp visual style it will
come? how can i show this toolbar in xp style settings?
pls help me....
This is the answer which i got
------------------------------
This is a bug in the .NET framework. You can work-around it by calling
Application.DoEvents() after EnableVisualStyles.
i tried this, but its not working,
after this also i can't see toolbar icons, i can see
only deviders, can u please explain me to solve this
problem...
with thanks
ajo
|
|
|
|
|
You should enable visual styles in a Main function, before your form gets loaded, then call DoEvents(). I recommend that you create a Main class and add the Main method there as shown below.
Public Class Main
Public Shared Sub Main(ByVal args() As String)
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MyForm)
End Sub
End Class
Next, you need to change your project setting's Startup Object to "Sub Main". You can find this option by right clicking your project in the solution explorer, click on Properties, select CommonProperties\General in the dialog's tree.
|
|
|
|
|
hi all
i m power user of the computers and i want to execute the programs in vb.net but i cann't do so. visual studio.net environament gives message.
Error while running the project:unable to start debugging
Access is denied verify that you r administrator or member of debugger user group on machine you are trying to run and so on tell me what i should do where to set the persmissions of execute the programs.
ddd
|
|
|
|
|
In order to debug an app (or run a debug version from inside Visual Studio), your acconut must either be a member of the local Adminstrators group or the Debugger Users group.
Right-click My Computer, click Manage, then open Local sers and Groups. I think you can figure it out from there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there a way to do this using VB.net? Without going through ASP I would like to directly quarry the db from my form.
|
|
|
|
|
Yes. There is no difference in doing a query from a program.
Use OdbcConnection or OleDbConnection, depending on the type of connection you have.
(By the way, a quarry[^] is a hole in the ground... )
---
b { font-weight: normal; }
|
|
|
|
|
(By the way, a quarry[^] is a hole in the ground... )
LOL! Thanx, well I was lost there for a while in the dark.
|
|
|
|