|
I have created a custom control in .NET and registered it with COM
interprop so as I could use it in a VB6 application. The control
contains a text box within it and when the control looses focus the
text box disappears. When I then double click on the control then the
text box reappears.
I can get the control to work by using the following code in VB6
Private ctrlExtra As VBControlExtender
Set ctrlExtra = Me.Controls.Add("TestControl.TestControl", "myCtrl")
ctrlExtra.Visible = True
If anyone can help with this then I will be truly greatful.
Martin Stevenson
|
|
|
|
|
I want to display a tree structure with the help of treeview control.My data is stored in database.It takes much time to retrive data from database and show it in treeview control.
Can i use XML to build the tree and show in the treeview control.If yes please tell me how with source code
|
|
|
|
|
Hi
I was wondering how I would be able to run an .exe file from within a function.
Thanks
Nitin
|
|
|
|
|
You can use the Shell function :
l_vRetVal = Shell(_your_exe_path_and_name", vbNormalFocus)
This will asynchronously run the given .exe file.
Have a look in the MSDN to understand the meaning of vbNormalFocus and to know the other possibilites.
If you don't want to run it asynchronously (ie : you want the your function waits until the exe is finished), you'll have to create a process. If you need, I can give you more infos on that.
Jerome
|
|
|
|
|
An even simpler (and apparently more thread-safe for some reason that someone once told me that I can't remember!) is to use ShellExecute function - use the API viewer to get the VB prototype
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi...I have constructed several Master-Detail forms using
the data wizard in vb.net. Most of the time, but not
always, a user will be entering data into the datagrid and
an extra row appears, like magic, below the row they are
working on and it will have a duplicate of the information in the
row above it. But the data is not really there!
Anyone know what this is ????? Also they
have to do an 'update' on each row. Is there anyway for
them to be able to enter two rows of data and then do the
update? Also I end up with many concurrency errors and
foriegn key problems...any advice....Thanks in advance.
Thanks,
Mike
|
|
|
|
|
It's hard to tell without any code, but maybe you are having a problem known as "cross product join", where your join condition on the master/detail query is flawed and makes the SQL Server returns multiple combinations of results.
As a sample, imagine two tables where they must be joined by the fields A and B. If, in your join condition, you forget to specify one of them, this can lead this kind of problem. Another situation is forgeting to specify a join condition for a table used on a query.
I see dumb people
|
|
|
|
|
Hi Daniel...Thanks for the reply to my post. I can either put the code in a reply or email it to you if you're curious - I ask because it is a couple thousand lines of code generated by the data wizard. If you had a suggestion of what specifically to look for, I could copy and paste it to a reply. On another note, do you know if you can 'update' (uses a merge I believe) more than one row at a time? Again thanks. Mike
Thanks,
Mike
|
|
|
|
|
Hello people =)
I want to take a selected row from a ListView and transfer the information to TextBoxes or Labels. How do I do it?
/Marcus
|
|
|
|
|
Hi,
For example, if your listview (lswMyListView) has two columns, and you want to transfer the selected row into two textbox (txtColumn1 and txtColumn2) you have to do that (for instance, in the lswMyListView_Click procedure) :
txtColumn1.Text=lswMyListView.SelectedItem.Text
txtColumn2.Text=lswMyListView.SelectedItem.Subitems(1)
Hope this helps !
Jerome
|
|
|
|
|
Hi
I am having a problem assigning a date to a date field in an Access database using VB. I know how to do it using a string.
Dim stLinkCriteria As String
stLinkCriteria = "[Name] = 'whatever'"
Do I somehow use the #'s ?
Thanks
Nitin
|
|
|
|
|
try...
Dim strLinkCriteria as String
strLinkCriteria = "MyDate = #" & Me.ctlWhatever & "#"
the principle being that 1) any string that can be evaluated as a date, and 2) is enclosed in #'s, will 3) be evaluated as a date, so if Me.ctlWhatever.Value = "2/28/03" then...
strLinkCriteria = "MyDate = #2/28/03#" 'm/d/yy
no matter where you go, there you are
|
|
|
|
|
dear all,
how can i unload a Form from the Form_Load event
if i use Unload me , i get an error Object Unloaded
plz. help
|
|
|
|
|
Hi !
I guess this won't help, but I tried to do this :
Private Sub Form_Load()
MsgBox "Hi !"
Unload Me
End Sub
and everything works fine.
Are you doing something special into the Form_Load event ?
Jerome
|
|
|
|
|
i'm checking the existence of previous instance of my app using following code
If App.PrevInstance Then
MsgBox "An Instance Of The Application Is Already Running!", vbCritical, "Already Running"
SetForegroundWindow
End
End If
it is working alright
but i was pondering over 2 scenarios
1) if i use unload me instead of End then the msgbox comes as if it is in an infinite loop (keeps popping up when i press OK)
2) if a prev instance is running, i want the running application to get on top of all windows.
i know i've to use SetForegroundWindow, but i've no clue waht to pass in the parameter
any help will be appreciated
thanx in adv
|
|
|
|
|
Ok im using VB.net, a console app.
I am making a database that stores games(members also, name, genre, rating)
i'm dividing the main code into some sub procdures and functions for easier readability.
So i have one sub for displaying the main menu(add, view..etc)
But now i wanna make a function to add a game to the array...
so i ask the user for the info, but how do i return all the values seperatly??
i tried assigning them directly to the
array(gameArray.name = console.readline()), but it doesnt work...
Any ideas will help!!
______________________________________________
"I'm not me when I dream...anymore." -TRUSTcompany
|
|
|
|
|
It sounds like you want to build a function that askes the user for three items and then returns those items so they can be used in anohter part of the program...
Buld a structure as so and declare it outside the function:
Public Structure InputData
Dim arg1 As type_name
Dim arg2 As type_name
Dim arg3 As type_name
End Structure
In your function create an instance of the structure, get all your input and assign each piece of input to each structure member:
Public Function GetInput() as InputData
Dim userResponse as InputData
'Get your input here
.
.
.
'assign each pice of input to your structure members
userResponse.arg1 = inputValue1
userResponse.arg2 = inputValue2
userResponse.arg3 = inputValue3
'return your data from the function
Return userResponse
Now you can call the function as so:
Dim returnData as InputData
returnData = GetInput()
From here if you want to pass it to another function to write the data to a DB you can simply do this:
Public Sub WriteDataToDB(inData As InputData)
'open the DB
'write each value to the DB
'you access each argument by the following
inData.arg1
inData.arg2
inData.arg3
.
.
.
End Sub
Hope that helps and I hope there are few typos
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Unknown wrote:
"I love long walks, especialy taken by those that annoy me."
|
|
|
|
|
Thanks Ray that kinda helps...
but i'm still not sure why i'm doing that...
Maybe i didnt explain it good enought..
I making an array, that has 3 members (name, genre, rating)
Overall i want a little menu
1) Add a game
2) Display a game
3) Show average rating of games
4) Quit
Something like that..so first i made a sub prodecure that displayed this menu (so i can call it after each option the user makes), that was all good
So the sub main looks like this so far
Private Sub Main()
Dim gamesArray() as Game 'Game is a declared structure above sub main)
Dim choice as integer
call DisplayMainMenu()
choice = console.readline()
End Sub
So then I started to do this:
Private Sub Main()
Dim gamesArray() as Game 'Game is a declared structure above sub main)
Dim choice as integer
call DisplayMainMenu()
choice = console.readline()
If choice = 1 then
* call AddGame()
End if
End Sub
Private Function AddGame()
console.write("Enter the game name: ")
name = console.readline()
console.write("Enter the genre: ")
genre = console.readline()
console.write("Enter the games rating: ")
rating = console.readline()
End Function
*** So my question being, if i get the info for the game in the function..
i somehow need to get all 3 pieces back up into the array...
Hope this clarifies things...
EDIT: Sorry forgot the IF
______________________________________________
"I'm not me when I dream...anymore." -TRUSTcompany
|
|
|
|
|
Hi
I was wondering how I would be able to assign a date to a date object.
Dim temp As Date
temp = ?
Thanks
Nitin
|
|
|
|
|
temp = #February 12, 1985#
you put any valid date expression between two #
|
|
|
|
|
I just installed VS.NET. Why is it that if I try to code in the html editor all the toolbox items are grayed out? However, if I go to design, they appear. Can I not use these buttons if I am coding by hand??
|
|
|
|
|
are you sure you're eding html ?
all items in the toolbox appear both in design and code when i open html file !!
|
|
|
|
|
Actually, the HTML tools are there, the ones I can't get to are the web form tools. I am editing ascx, aspx and they don't show unless I'm in design mode..
|
|
|
|
|
The use of apostrophes in a textbox, when using collaboration with a SQL statement causes trouble - i was wondering if theres any way to get around this - ie when inserting a value that contains an apostrophe, to omit it before using the SQL insert statement. Any help would be greatly appreciated!
|
|
|
|
|
You can use StringVar=StringVar.Replace("'", "") to remove the apostrophe from your string (where StringVar is your variable). There may be something more elegant, but this has worked for me.
|
|
|
|