|
hellow to all ..
i have datagrid in my form .
how can i get information from the field in the datagrid when i pick it or mark it .
thxx a lottt ..
|
|
|
|
|
Use CurrentCellChanged event.
Then to access the tex use:
<br />
Dim cellText as String<br />
dim row as integer = myGrid.CurrentCell.RowNumber<br />
dim col as integer = myGrid.CurrentCell.ColumnNumber<br />
cellText = myGrid(row,col)<br />
|
|
|
|
|
I'm using DataRowCollection.Find method to locate a row in a DataTable as shown here:
Dim newrow As DataRow
newrow = MyDataSet.MyTable.Rows.Find(5)
After finding the row how do I update all the bound controls on the form to that row. I've used the BindingContext(MyDataSet,"MyDatatable").position in the past and if I use it here how do I know what the position number is?
Thanks again for any help.
|
|
|
|
|
Try using DataView.RowFilter. Reason is that you will get direct access to the DataRow record; however, with find I think you just get a copy of the DataRow record.
|
|
|
|
|
When I load a datagrid from a database, there is a date column that is brought across. But instead of just displaying the date, it displays the Date and an empty time display.
So I get something like this.
Date
---------
30/07/2005 00:00:00
30/07/2005 00:00:00
06/08/2005 00:00:00
When I should be getting :
Date
----------
06/08/2005
|
|
|
|
|
I use:
<br />
Dim newTime As Date = Now.Date<br />
Dim strNewTime As String = newTime<br />
Hope that helps.
Thanks,
Taen Karth
|
|
|
|
|
I am a vb.net learner. Is there any easy utility in vb.net to declare/define procedure like Tools-->add procedure like VB6.plz give me reply.
|
|
|
|
|
I dont think so I never saw it in vb.net. any ways to define a procedure or function is not a big issue it is same like vb6.
private sub abc()
end sub
or
private function abc()
return true
end function
|
|
|
|
|
Hi, I have to create a mutli user application in VB6 with MS Access as the backend. How do make sure that a record, if opened by one user, cannot opened by another user?
Sreejit
|
|
|
|
|
Hello everyone..
I have this task where I have to develop a customized media player that can play the following;
1. All types of movie files (wmv,asf,avi,mpeg,mov, etc.)
2. All types of audio files
3. Flash files (swf)
3. PowerPoint files
The player will read a playlist, which is an xml file, and then retrieve the contents from a server, and play the files accordingly.
Another issue is how to go about streaming the contents. I'm thinking of while playing the first file from the list, the second file will be downloaded at the same time. The idea is when the first file is done, the second one will take place, and so forth. The contents will be published on a plasma tv.
Can anyone help me on how to code this in vb.net? Any suggestion on the application design? Any sample codes that I can get from the internet for my guidance?
Thanks in advance for helping..
Alkazam.
|
|
|
|
|
VB.NET is utterly incapable of writing a movie player. However, it's also true that it's a waste of time to do so anyhow, when several exist already.
You want to embed the Windows Media Player control in your app. Do NOT use managed DX, as it's utter crap ( see my article ). You will have to embed something else for swf files, probably IE, and I have no idea if you can embed PowerPoint or not.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
In VB 6.0 , how to set a node to the top of the treeview?
There is many node in a treeview,we could scroll the bar and select the node.
However, I want to select the node by code, and show it to the user, not hiden in the scrollbar.
Thanks!
|
|
|
|
|
This is my message.
I clear the cookie and do not login just a moment ago.
|
|
|
|
|
If you are trying to make a node move to the top of the TreeView:
Dim tmpText As String
Dim tmpChecked As Boolean
TreeView1.Nodes.Remove 10
TreeView1.Nodes.Add 1, , , tmpText
TreeView1.Nodes(1).Checked = tmpChecked
Or if you want to make sure the user can see the node:
TreeView1.Nodes(9).EnsureVisible
There is probably an easier way of moving nodes. Hope this code helps you.
|
|
|
|
|
Is it possible to make a form unmovable? If so, please give some hints on how .
|
|
|
|
|
Catch the move event and move the form back to where you want it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Use the following API:
SetWindowPos Me.hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
|
|
|
|
|
hey, i'm trying to get the address from an IE window starting with "Hello There", but i ran into some problems. i'm using VB6. here's the code :
[code]
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Sub Form_Load()
Dim hMain, hNext, winhandle As Long
Dim wintitle, address, tmp1 As String
Const GW_CHILD = 5
Const GW_HWNDNEXT = 2
hMain = GetDesktopWindow()
hNext = GetWindow(hMain, GW_CHILD)
While hNext <> 0
hNext = GetWindow(hNext, GW_HWNDNEXT)
If IsWindowVisible(hNext) <> 0 Then
If Len(wintitle) > 0 Then
If wintitle <> "Program Manager" Then
If Left(wintitle, 11) = "Hello There" Then
winhandle = FindWindow("IEFrame", wintitle)
winhandle = FindWindowEx(winhandle, 0, "WorkerW", 0)
winhandle = FindWindowEx(winhandle, 0, "ReBarWindow32", 0)
winhandle = FindWindowEx(winhandle, 0, "ComboBoxEx32", 0)
tmp1 = SendMessage(winhandle, WM_GETTEXT, 24, address)
End If
End If
End If
End If
Wend
End Sub
[/code]
the first hNext returns a handle, but the first line after while doesn't.
can anyone correct the above code?
|
|
|
|
|
You can do this much easier by using the Shell.Application object. Here's a little VBScript sample:
Dim objIE, i, count
Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows
count = objShellWindows.Count
WScript.Echo "Shell Windows: " & nCount
count = count - 1
for i = 0 to nCount
set objIE = objShellWindows.Item(i)
if (not objIE is nothing) then
WScript.Echo " #" & i + 1 & " Location Name: " & objIE.LocationName
WScript.Echo " #" & i + 1 & " Location URL : " & objIE.LocationURL
end if
next
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i put the script in VB6 in Private Sub Form_Load() but when i try to run it it says Object Required on this line : WScript.Echo "Shell Windows: " & nCount
|
|
|
|
|
That was NOT copy and paste code! I said that was VBScript, not VB6! It has to be converted to VB6 with a little effort.
WSCript is the scripting host that runs the code. WScript doesn't exist in VB6, but you can still use the Shell.Application object. Set a reference to "Microsoft Shell Controls and Automation", then you can create a Shell object and use it's Application property, just like in the sample code.
Dim shell As New Shell32.shell
Set objShell = shell.Application
count = objShell.Windows.Count
For i = 0 To count - 1
Set objIE = objShell.Windows.Item(i)
...
Next
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello people
Urgently need some help please please.
I am currenlty creating a programme, and i need code for the following if possible.
I am trying to make a label turn yellow when it generates random numbers 1-9.
I have 6 labels which all generate random numbers between 1-50 in all of the 6 boxes in any order any 1 number will not be generated twice.
I hope this makes sense
SARAH
|
|
|
|
|
Does a label have a Brush property ? It's my recollection that it doesn't, I had to write my own Label control in order to be able to specify the brush used to draw the text.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
SARAH,
Dim intRandom As Integer
Dim originalColour As System.Drawing.Color = Me.Label1.BackColor
intRandom = cint((rnd() * 49) + 1)
If intRandom > 0 And intRandom < 10 Then
Me.Label1.BackColor = Drawing.Color.Yellow
Me.Label1.Refresh()
Else
Me.Label1.BackColor = originalColour
Me.Label1.Refresh()
End If
Regards
Richard
|
|
|
|
|
I know this is a silly question. But how do I define the columns in a dataset.
So after I have created a new dataset,
Dim DS as DataSet
How do I add columns. I know how to do it to a dataset that has already been filled from a database, but this does not appear to work for newly created DataSets.
|
|
|
|