|
I need to grab data from labels on my form so I can perform calculations and other things. Problem is I get a item not declared in the module. I would operfer to put the majority of the code into modules and call as necessary. How do I reference the texytboxes, labels and such in the module. E.g grab the values of the objects input them into the module and return what I need.
I have no problem creating functions, it;s just that I perfer to place my functions into a module and call accordingly.
|
|
|
|
|
If I have understood you correctly: You should use the name of your form or in better words the instance of the form which is beind displayed as follows:
frm.Label1.Text, frm.Text1.Text etc.
|
|
|
|
|
I am trying to capture a windows display, but even if it's off the screen.
The BitBlt api works only for a window that is on the screen, as soon as you move it off the screen or mininmize it you can't capture that windows information.
The OleDraw api is almost what I need but it requires you to pass in the object's IUnknown Interface as one of the arguments and I don't know how to find an objects IUnknown Interface.
My question is either, how do you get an objects IUnknown Interface only knowing the windows handle or is there another api like OleDraw that I should be using when I only have the windows handle, to capture the windows display when it's not on the screen.?
|
|
|
|
|
bountycode wrote:
I am trying to capture a windows display, but even if it's off the screen.
You're wasting your time. You can't capture what is never drawn in the first place. This has been discussed in the boards over and over again.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave,
That is not correct, you can capture what the control is displaying even if it's off the screen using the OleDraw api. I've tested this using an embedded browser control on a form and even setting the text property of a command button while it's off-screen then using the OleDraw api I was able to get the correct information that was on the browser and command button. This works because I can pass in the object for the OleDraw api just by referencing the control by name. What I don't know how to do is pass an object to the api from just the handle to the control.
|
|
|
|
|
It works because you're giving the target object a different device context to draw on. You're forcing the control, and it's child controls, to redraw itself on the new device context. It works great for controls that implement the IViewObject interface. Unfortunately, not every control/form/window does this, but Internet Explorer's components do implement it.
The technique can be used to capture the image of HTML as rendered in a browser window. This is how Windows Explorer can generate a small preview of an HTML file in the left pane of an Explorer window.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have an application I wrote using vb.net 2003 and my screen size is 1024x768 and everything looks great. I then transfer that application to another computer who's screen size is 1024x768 and my screeen does not fit? Any way to fix this?
|
|
|
|
|
I don't understand...Both screens are the same size and one looks different??
Thanks,
Taen Karth
|
|
|
|
|
Yes, the LapTop form exceeds the screen size.
|
|
|
|
|
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++
|
|
|
|