|
I should say:
When this child form is set as the startup form, it obeys the .selectedindex = -1, and doesn't display a value until the cbo value is selected. Any one know?
|
|
|
|
|
i no this is a common bug when the desired startup object changes its name and this has happened to me.
I had a single form then added a second then deleted it and now when i try and compile it comes with the error sub main not found in ....(name of project) can any one help please???
|
|
|
|
|
Instead of setting your form as the startup object, why not change it to "Sub Main"? You can launch your form from there.
Public Class Main
Public Shared Sub Main(ByVal args() As String)
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MyForm)
End Sub
End Class
|
|
|
|
|
Hello!
Yes I know I have already posted two more questions (sorry!). But I was wondering how I could show a place holder for a picture box at runtime. I should be able to adjust the size of the picture by holding the one edge of picture. Whenever I go over the picture by mouse, placeholders must show up and then I should hold the one edge of it to resize it...
uh!
Thanks
|
|
|
|
|
You need handle the PictureBox's MouseEnter and MouseLeave events as follows. You can make it display an image at runtime by setting the PictureBox.Image property.
Private Sub PictureBox1_MouseEnter(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles PictureBox1.MouseEnter
PictureBox1.Image = myImage
End Sub
Private Sub PictureBox1_MouseLeave(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles PictureBox1.MouseLeave
PictureBox1.Image = Nothing ' Clear the PictureBox.
End Sub
You can make the entire image fit inside the PictureBox by setting the PictureBox.SizeMode property to StretchImage.
|
|
|
|
|
I was wondring if there is a way (statement) to create clips for a picturebox. Likely place holders showing on the edge of the picture. It is likely not dealing with a image but something arround the image (a frame with the clips)....
|
|
|
|
|
I'm not sure if I understand what you want here.
Do you want several images reduced in size at one side of your PictureBox? Like say the bottom, kind of like Microsoft Explorer's Film Strip mode?
If so, then there is no "magic" function to render this for you. You're going to need to handle the PictureBox's Paint event and draw these clips there yourself via GDI+. Have a look at the System.Drawing namespace.
|
|
|
|
|
Hello!
My aim is to get command line arguments inside the code. Would you please show me the statement for the purpose. How can I get multiple arguments that are passed via executable program name. eg( abc.exe c:\def.jpg)
Thanks.
|
|
|
|
|
The easiest way to do this is to change your project's Startup Object from your form to "Sub Main". You can get the command line arguments from there as follows.
Public Class Main
Public Shared Sub Main(ByVal args() As String)
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MyForm)
End Sub
End Class
An alternative to this is to call System.Environment.CommandLine . The difference here is that it gives you the whole command line as one string and you have to parse it yourself.
|
|
|
|
|
Hello!
It is not possible to hide or disable a tabcontrol's tabpage in VS .NET 2005. If anyone of you a way to hide or disable the tabpage please let me know or feel free to suggest me an alternative solution for the problem.
Thanks!
|
|
|
|
|
Removing the TabPage from the TabControl's collection effectively hides it. You can reshow it by Adding it back into the collection again.
MyTabControl.TabPages.Remove(MyTabPage)
|
|
|
|
|
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!
|
|
|
|