|
What is form handle in .net and at what time we will create and use them?
|
|
|
|
|
.NET is a wrapper on Win32, so a handle, is basically the same thing it's always been. You never create one, it's just something that every form has, because it is, at the end of the day, a Win32 window.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You may use the handles of forms when using API commands.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi all,
How could I take the values of cells in the dataGrid and use them outside the dataGrid
e.g:
i have TimeIn & TimeOut for a certain person during one month (or more or less)
i need to calculate the total hours ' in the specified time and view the total in a textBox
syntax help (examples) is also needed
thank you
|
|
|
|
|
There are really 2 choices here. You can grab the values out the datagrid, which means you would probably want to use the OnItemDataBound event and calculate the hours for each row as it is added or you can look at the datasource you are providing and get the values from there.
For the OnItemDatabound event you can do a case statement like this (this is from memory so forgive me if it isnt exactly correct) -
Select Case e.Item.Type<br />
Case Item<br />
'Calculate from cell contents and get a TimeSpan object<br />
ts = Convert.ToDateTime(e.Item.Cells(#).Text).Subtract(Convert.ToDateTime(e.item.Cells(#).Text)<br />
<br />
txtTotalHours = ts.TotalHours<br />
End Select<br />
Something along those lines, I hope that helps!
Cleako
|
|
|
|
|
Hi, i will try to solve ur problem. The values u entered i mean the employee values that was stored in a table right, again if u want to retrive that values and display on data grid right, if yes means the values u stored in data grid while retriving then create a local variable that supports the perticular data type on which u are operating, with the index of the recordset suppose TimeIn t1 and TimeOut t2 then t2 - t1 for every loop of that perticular employee and keep adding the result to the local variable at last when the record set is empty then assign the value to the textbox out side the grid,I think u may confused but i did it, if u want more information abt this then mail to me
|
|
|
|
|
thak you both Rahul Appu & cleako
srour_costavo@hotmail.com
this is my email so if u have msn add me and we can discuss more online
10x a lot
|
|
|
|
|
how could I convert a value in the dataGrid to string in order to use it outside the grid?
|
|
|
|
|
You either need to do something like OnItemDataBound because that will let you access each row or you will need to know the row index and cell number in order to access the .Text property which returns a string. I have found that many times though it will return a & nbsp; (spaced so it will show up) value so I almost always do a .Text.Replace("& nbsp;", "") on the value to make sure I dont have that HTML space.
Check out http://www.datagridgirl.com/[^], there you will find many datagrid answers.
Cleako
|
|
|
|
|
I'm a newbie at VB.Net so please don't smite me for this stupid question
I have a form with various buttons eg. movies, music, setups etc.... and i would like a windows explorer window to open up to the relevent directory on my HDD. Example if i clicked "Movies" it would open "D:\Movies" in a normal windows explorer window.
The only problem with my plan is that I don't know the code to make this happen. so could anyone help me??
Thank You
|
|
|
|
|
Process.start will take a path, and open it, I believe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks a Million Mate that worked!
|
|
|
|
|
You need to include a FolderBrowserDialog in your program.;)
|
|
|
|
|
Why? The specs in the OP didn't say anything about picking the folder...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: Why? The specs in the OP didn't say anything about picking the folder...
I have a form with various buttons eg. movies, music, setups etc.... and i would like a windows explorer window to open up to the relevent directory on my HDD. Example if i clicked "Movies" it would open "D:\Movies" in a normal windows explorer window.
You can also tell FBdialog what dir to start from, which open up in a windows explorer windows.
Which is what the person wanted.
As long as everybody is happy and get the answers that help them.......
|
|
|
|
|
He says, he's a newbie. To me, that means he want to open a hard coded (I know, bad idea!) path for each button.
Now, if he wanted to write a configuration section for his app, then he can supply the FBDialog to get the folder and make the app a bit more user friendly. But, I didn't see that in the OP.
I know, it sounds like I'm harpin' on you. I'm really not. If the OP wants to finish reading this thread, then he can see this idea and start asking questions to take his app to the next level.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi I am having the function like this,
Public Function GetColorFromString(ByVal strColor As String) As System.Drawing.Color
Dim colConvert As New ColorConverter
Return colConvert.ConvertFromString(strColor)
End Function
I got error while compiling
"Option Strict On disallows implicit conversions from 'System.Object' to 'System.Drawing.Color'."
How to resolve it?
Be simple and Be sample.
|
|
|
|
|
Do the cast explicitly ( however you do that in .NET ). CType, I think.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Yes I got it, I have used like this,
Public Function GetColorFromString(ByVal strColor As String) As System.Drawing.Color
Dim colConvert As New ColorConverter
Return CType(colConvert.ConvertFromString(strColor), Color)
End Function
it is working thanks.
Be simple and Be sample.
|
|
|
|
|
Hello, i need to implement a Progress Bar into my application, the progress bar's listed in this forum and the ones that I found on google, did not match with what I was looking for.
My application is a basic and simple app, which is useful at the same time, it will allow the user to select a application from the listbox and download it to their desktop, where you are not required to register, await comfirmation or anything like that when downloading free applications online such as, AVG, Spybot etc. (I am aware AVG, Spybot do not require a sign-up to download them, I just used them as a free application example)
I am in need of help to get a Download Progress Bar which determines the % completetion of the file being downloaded, more like a Download manager.
How would I go about doing this? here is a theory I came up with:
- Specify the file size, the ping and the connection speed for each site that it will download from (Each application will have 2-3 different mirrors).
Kind regards,
Syri
-- modified at 5:17 Wednesday 14th February, 2007
|
|
|
|
|
Each of thse applications downloads their code using their down, custom written, download component so that they can get the progress in bytes, not time. You'll have to do the same because the built-in methods in the .NET Framework don't report back any kind of progress.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
you need know the total bytes to download, each byte is calculated as a porcent of total, where total bytes is 100%.
Progressbar Max property = 100
value = (bytes recibed / total bytes to recibed) * 100
To know the total bytes you must add every files sizes, if you are using http headers in response from server under http 1.1 i believe what the server must say the total size of file.
Cuando salga el sol, no estare aqui...
|
|
|
|
|
:(I wnt to run my exe on other computer but it is giving error only when i open report through my project.
on the machine where i m trying to run my exe, not having crystal report or .net installed.
I hav installed there .net connector & .net framework & application is running ok.
But for running crystal reports wht is needed?
Anyone Please help me soon.
Thanks.
priya
|
|
|
|
|
Hi i too having the same problem, but i rectify it and executed the exe succesfully. For this type of problem mainly some .dll files and .ocx files which support crystal reports are missing in ur system notify the file name and register that files to ur system and try, surely it work.
|
|
|
|
|
Hi thanx for help,
but will u please tell me how i come to know that which .dll & .ocx files support crystal reports are missing in my system?
Please tell me as soon as possible , as i dont have much time.
Thanx.
-Regards Priyanka.
priya
|
|
|
|