|
I don't know your code but you don't need tabcontrol at all. Try making a button in your first form and place the followincode
Dim SubForm2 As New yourcurruntformname
'Display the new form.
SubForm2.Show()
|
|
|
|
|
I am trying to use the ReportViewer control in VS2005 (VB). I have set up a report, and it works great to use a set query to fill the reports. I would like to allow the user to enter data at run time, and then generate a query to create a new dataset. I would then like the report to use this new dataset as its datasource.
There seems to be a lot out there on Crystal, but not much for the ReportViewer that comes with VS2005. Can anyone help me with changing the data source of the report at runtime?
Any help would be greatly appreciated. Thanks in Advance!
Mark G.
|
|
|
|
|
Hi there,
I just upgraded an interactive app for traffic & transportation modeling to vb.net, it works excellent and its fast contrary to expectations. however i got a huge problem. everytime any control gets repainted, the graphics or the simulation running disappears. so i browsed through the internet and learned that i have to override the Paint function and make everything to be drawn to go out from teh picture or panel paint function. this works excellent in small cases and apps, but i got about 25 classes and 20 forms ? each of these classes generates a part of the simulation. does anyone know how i can keep my GDI+ graphics from disappearing, with an actual code.
for example
public sub CodeDisappear()
fix my stinking problem bill gates
end sub
Thanks,
Dassouki
|
|
|
|
|
Hi I create a contextmenu from data. my code is this
Private Sub devsubmenu()
Dim cmddev As New OleDbCommand("Select modelname from devicetbl", OleDbConnection1)
OleDbConnection1.Open()
Dim dtread As OleDbDataReader = cmddev.ExecuteReader()
devmnu.MenuItems.Clear()
Do While dtread.Read
devmnu.MenuItems.Add(dtread.Item("modelname").ToString())
Loop
OleDBConnection.Close()
End Sub
The menu created is fine.
Now when i click one of the menu items created with the code above i want to take the "text" of the menu item and store it to a variable.
Here is my problem, how can i handle a click event from these items?
Any Ideas???
|
|
|
|
|
Instead of adding like this
devmnu.MenuItems.Add(dtread.Item("modelname").ToString())
do this
Do While dtread.Read
Dim ChildMenu As New MenuItem
ChildMenu.Text = ""
AddHandler ChildMenu.Click, Procedure name to use
devmnu.MenuItems.Add(ChildMenu)
Loop
Rizwan Bashir
|
|
|
|
|
ok i changed my code to :
Do While dtread.Read
Dim ChildMenu As New MenuItem
ChildMenu.Text = dtread.Item("modelname").ToString()
AddHandler ChildMenu.Click, model_click
devmnu.MenuItems.Add(ChildMenu)
Loop
i inserted a breakpoint in procedure model_click and when i click my menuitem the program isn't calling my procedure
Private Sub model_click(ByVal sender As System.Object, ByVal e As System.EventArgs)
do domething ...
end sub
Thanx
|
|
|
|
|
use this line to add the handler
AddHandler ChildMenu.Click, addressof model_click
Regards
Rizwan Bashir
|
|
|
|
|
sorry you are right.
i noticed that after i posted the message
you where very helpful but now do i get the text of the menuitem which is declaerd within the do while statement in the handle procedure model_click?
this is my code
Private Sub devsubmenu()
Dim cmddev As New OleDbCommand("Select modelname from devicetbl", OleDbConnection1)
OleDbConnection1.Open()
Dim dtread As OleDbDataReader = cmddev.ExecuteReader()
devmnu.MenuItems.Clear()
Do While dtread.Read
Dim ChildMenu As New MenuItem
ChildMenu.Text = dtread.Item("modelname").ToString()
AddHandler ChildMenu.Click, AddressOf model_click
devmnu.MenuItems.Add(ChildMenu)
Loop
OleDbConnection1.Close()
End Sub
End Sub
Private Sub model_click(ByVal sender As System.Object, ByVal e As System.EventArgs)
' Get childmenu.text here
End Sub
|
|
|
|
|
sender is the menu. so
sender.text is the text and so on. you can play with the properties using
sender. Name of property
Rizwan Bashir
|
|
|
|
|
Thank you !!!
|
|
|
|
|
I have a program that can scan an image. I have a msgbox come up after each scan asking if the user wants to add a page to the original scan. Can anyone help me with this problem. Below is the code:
NextPage:
On Error GoTo ScanErr
'Scan an Image
If ImgScan1.ScannerAvailable = True Then
With ImgScan1
.OpenScanner
.StartScan
End With
ImgEdit1.Image = ImgScan1.Image 'sets imgedit1 to show scanned image
ImgScan1.CloseScanner 'close scanner
Else
MsgBox "Scanner Not available!", vbExclamation, "Error!"
End If
ScanErr:
If Err.Number = 1002 Then 'Exited without scanning
Exit Sub
Else
Exit Sub
End If
-- modified at 14:58 Monday 8th May, 2006
|
|
|
|
|
use this
With ImgScan1
.MultiPage=true
.OpenScanner
.StartScan
End With
' adding multi page will not stop the scanner. Like if you have ADF Scanner then it will stop when all the papers are scanned in feeder.
Regards
Rizwan Bashir
|
|
|
|
|
I have a project that I have successfully completed using VISUAL BASIC 6 PROFESSIONAL and ACCESS as back end. Now I want to convert this codes to VB.NET how do I acheive this or how do I go about it.Thanks
Ademola
|
|
|
|
|
After ensuring that your VB6 prog works without errors do...
Run VB.Net open the vb6 project using file/open project this will lauch the upgrade wizard. A few seconds/minutes later there will be a _UpgradeReport.html file in solution explorer.
Study that document it should tell you what it was able to upgrade and that which it could not, and prepare for some disappointments. The upgrade wizard tries its best but is not perfect.
In any case, fire-up the help file that comes with vb.net and search the index for "Upgrading a project with the upgrade wizard" and it walks you through what happens.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Thanks for your respond. but i want to know may be this is applicable as to convert VISUAL BASIC 6 TO VISUAL STUDIO 2003 AND 2005 as the way I will convert it to VISUAL STUDIO .NET
Ademola
|
|
|
|
|
Yes, I understand they are similar.
BUT
As in my original reply, the MSDN help file will guide you.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
how to add a windows control(e.g. Button Control) to a collection
Suman
|
|
|
|
|
What kind of collection do you mean?
ArrayList list = new ArrayList();
list.Add(button);
|
|
|
|
|
'Declaring Collection
Dim mycol as collection
'If I have two button control button1 & button2, Then I want to add this two button to the collection so that I can control them using
"For each button in mycol " command
Thank you
Suman
|
|
|
|
|
Dim coll As Collection
coll = New Collection
coll.Add(Button1)
coll.Add(Button2)
Dim b As Button
For Each b In coll
b.Text = "Got you!!!"
Next
|
|
|
|
|
hi
please send me source code for audio recording for incoming/outgoing voice.
advance thanks
purnachender@photontelecoms.com
|
|
|
|
|
Firstly your question is one of the vaguest I have heard. What exactly do you want to capture. Do you want to capture audio from a microphone plugged into your PC or from a modem or from a VoIP phone?
Secondly nobody will send you the source code. Most people however will be willing to help with a specific problem. I will forgive the rather aggressive and ignorant tone of your question as I am guessing English is not your fist language. Others may not.
So….. If you are really at a total loss try google. Its pretty good for general ‘How do I …?’ type questions.
(It wasnt me who voted you a 1 by the way. In case you dont know a 1 vote means somebody was a little bit annoyed by your post).
Jon
|
|
|
|
|
Afternoon All
i was hoping some 1 could guide me in the wright directione here. Is it possible that in the Datagrid.click function that the line you click in the datagrid can become highlighted and several other lines highlighted if clicked. i really need to find this out(and don't say keep ur finger on control and click). I want to highlight 1 or several rows that have been clicked
regards
Allan
|
|
|
|
|
Hello,
I want to initialize a variant in VB6. I want this variant to hold a double arrary. To do so, I did the following .
<br />
Dim a(0 To 6) As Double<br />
Dim Points As Variant<br />
<br />
a(0) = 0#<br />
a(1) = 0#<br />
a(2) = 0#<br />
a(3) = 0#<br />
a(4) = 0#<br />
a(5) = 1.2<br />
<br />
Points = a
This piece of code does not give me any error on compiling as well as on run time. but the trouble in "Points" in not filled. and when it is passed to one of the activeX controls I am using, it has nothing in it. I think I am not doing enough to intialize the variant. Can any body suggest me the right way of doing it.
thanks
|
|
|
|
|
This code will create a variant array named Points that holds 6 elements of type Double. If it isn't being received by the activeX control, then something else is wrong. How is the receiving function defined, and how are you passing it?
----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin
|
|
|
|