|
Sorry, there is an extra ^ at the end.
|
|
|
|
|
It happens to the best of us
|
|
|
|
|
Hi All,
I am writting a CRC program (for Windows use) now for my project. But, the code not working so far. Any of you have a sample code for me?
Code in VB.Net is my preference.
Thanks in advance!
FG
|
|
|
|
|
Your going to have to post a more specific question!
What's not working? What are you having a problem with?
RageInTheMachine9532
|
|
|
|
|
Hi,
The whole programming can't run. When I run, it show me some header file cant work.
Please advise.
Thanks.
|
|
|
|
|
You can do better than that! What's the EXACT message the compile spits out and what does the code look like around that line. Without it, there is nothing we can do to help you with the problem.
RageInTheMachine9532
|
|
|
|
|
Is there a way to access the programs that are built into the add/remove program in control panel. I want to be able to write a vb program or script that removes the .net framework silently. Is it possibly to access what happens when you go to the control panel and click add/remove programmically?
thanks in advance
lep
|
|
|
|
|
The easy way to uninstall an app is to use the System.Management classes and WMI. You would be using the Win32_Product class. The downside is it won't do a silent uninstall.
The hard way would be to use the Windows Installer API's. The documentation starts here[^]. The upside of using this method is that you get total control of how the uninstall behaves. The down side is it's complexity.
I hope your doing in in VB6 and not VB.NET. Trying to write a program in VB.NET to uninstall the .NET Framework is never going to work since you cannot uninstall something that your program absolutely needs in order to run...
RageInTheMachine9532
|
|
|
|
|
Hi all..
Can anybody there guide me regarding how to implement multilingua support in Visual Basic 6?
Basically, i m trying to build an application in which i could give different language options, and depending upon selected language option i would be able to change my application layout(in terms of language).
NOTE:
smaple codes will really help me a lot, as i m new in this filed.
Thanks in advance.
Regards,
ADARSH
|
|
|
|
|
I am trying to code a generic function under the Click event of an Edit > Copy menu. It needs to get the text value of the current textbox (or whatever) and place that value on the clipboard. I tried the following:
Clipboard.SetDataObject(Me.ActiveControl.Text)
However, the window form in question actually contains a grid and a second windows form container which has the actual text boxes on it. As a result, "ActiveControl" is in fact the containing control.
As a convert from a 4GL to VB.NET, I am struggling with the basic issues like getting the currently focused control. Most of the examples are so basic as to be useless in a real application. Any suggestions would be greatly appreciated.
Regards
David
|
|
|
|
|
Hi David
Try this:
Dim a module level string
e.g. Dim CurrentCtrl as string
In the GotFocus event of each control that you need to get the text, put the following code:
CurrentCtrl = Form1.ActiveControl.Text (replace Form1 with actual form/location name)
Then from your menu you can send the value in CurrentCtrl to the clipboard.
Below is some code to give you the idea, if you need it.
On the form is a frame; inside the frame are 5 text boxes. There's a menu with two options: To Clipboard and From Clipboard. Also on the form is a label: just displays what's on the clipboard when From Clipboard is selected from menu.
**********************************
Option Explicit
Dim CurrentCtrl As String
Dim LastCtrl As String
Private Sub Form_Activate()
Text1.SetFocus
End Sub
Private Sub mnuFromClipboard_Click()
Label1.Caption = Clipboard.GetText
End Sub
Private Sub mnuToClipboard_Click()
Clipboard.SetText (CurrentCtrl)
End Sub
Private Sub Text1_GotFocus()
CurrentCtrl = Form1.ActiveControl.Text
End Sub
Private Sub Text2_GotFocus()
CurrentCtrl = Form1.ActiveControl.Text
End Sub
Private Sub Text3_GotFocus()
CurrentCtrl = Form1.ActiveControl.Text
End Sub
Private Sub Text4_GotFocus()
CurrentCtrl = Form1.ActiveControl.Text
End Sub
Private Sub Text5_GotFocus()
CurrentCtrl = Form1.ActiveControl.Text
End Sub
*******************************************
Oh, by the way the module variable LastCtrl can be utilised by much the same code as in the GotFocus except it goes in the LostFocus event of each control
Anyhow this should give you a start in the right direction, I hope.
Budgieboy
|
|
|
|
|
Thanks for that. However if you have a lot of fields, this will result in a huge overhead in code. Or alternatively, I could place this in a class and inherit, but that still has issues. From this and other forums where I posted the question, it seems like VB.NET doesn't have what I was looking for. However another source provided a lead which resulted in the code below:
Private Function ClipboardCopy()<br />
<br />
Clipboard.SetDataObject(GetActiveControl(Me).Text)<br />
<br />
End Function<br />
<br />
Private Function GetActiveControl(ByVal container As IContainerControl) As Control<br />
Dim control As control<br />
<br />
control = container.ActiveControl<br />
If TypeOf control Is IContainerControl Then<br />
Return GetActiveControl(CType(control, IContainerControl))<br />
End If<br />
Return control<br />
<br />
End Function
This gives the result I was looking for.
Regards
David
|
|
|
|
|
Hi,
I'm making an application in VB and I need to have an option to open it on the Windows Explorer popup menu(show's when you right click a file) with all files but one(the file type my program actually reads) sort like winzip does. and for one special file type(the file type my program actually reads). I also need some special options on it's popup menu.
If anybody knows then please reply asap.
Thanks and Regards
Mayank Kumar
|
|
|
|
|
check the Shell programming section in codeproject
you'll find samples about extending the right click menu.
|
|
|
|
|
Dear All,
I am in such a need of creating a Window service for logging my internet In and Out timing.
That means When I connected to the internet my windows service should log the time of entering.
At the same time it should log the time of leaving also.
One more thing is that windows service should send the report to the dedicated mail account periodically.
Can anyone detail me how to create a Windows service to meet my req ?.
Your help w'd be appreciated.
Thanks
DHARMA.R
|
|
|
|
|
hi
I don't understand the first requirement of logging the entering time and leaving time. Coz if it is a web server then it will be online all the time right? Otherwise if u are talking about the time of logging into ur website then u can use ur client application to log the log in and logout time. Normally Login and Logout time are entering using the client app right?
Second requirement is straight: periodically send mails to various clients. For this you can use the windows service or it will be more easy and efficient if u goes for DTS Packages in Sql Server provided ur database shud be MSSQL Server. Simply create a DTS package and schedule to execute it periodically.
rgds..mil10
|
|
|
|
|
If you using a dialup connection, it's not so hard just monitoring IP for that connection. But this method won't work if your on a cable modem or some other permanent connection.
If you are looking at monitoring network traffic, then it will be an inaccurate accounting of the time since there, for the most part, is no traffic while your staring at the page you just downloaded.
A better method would be to monitor the task list for any instance of IEXPLORE or what name is being used for Netscape or whatever browser your using. If the instance is in the task list, you must be browsing the internet or at least viewing a page local to the machine. You would also have to monitor for any FTP client you happen to be using...
Another idea would be to write your own proxy server. You would be able to monitor all your connections independent of the client app that your using at the time, but again how do you know when your not viewing pages anywmore since the connection is only there when you are actually downloading something?
RageInTheMachine9532
|
|
|
|
|
Hi,
Thanks for ur interest.
This is what I need exactly.
I have a Pc with internet connection (Dialup connection).
My friends and family members are using that Pc for browsing websites.
I'd like to log the everyone's total time of internet using.
This will help me to track who uses internet connection more.
For eg. consider this situation (Assume everyone has seperate windows user account)
1.Friend1 login to Windows.
2.He connected to the Internet using dialup connection at 6.00 P.M
3.He browsing web pages.
4.Friend1 disconnect the internet connection at 8.00 P.M
Our Windows service should record the foll. details.
==================
Date : 06/04/2004
User : Friend1
In : 6.00 P.M
Out : 8.00 P.M
==================
Could u understand my prob.
Can u suggest me the soln. for this ?
Thanks in advance.
|
|
|
|
|
I already suggested methods of doing this, but it's not as easy as you may think it is. The only way to surely track that a connection is alive is if it is a dial-up modem connection. Since this type of connection is temporary and is not alive the entire time the machine is up, you can watch for changes in the IP stack, like gateway changes, that will occur when the connection is made and dropped.
If your using a cable modem or some other permanent connection, then this method will not work since the machine is connected all the time. You would have to monitor the process list for the various web browsers and FTP clients (by name!) to see how long the person is online.
RageInTheMachine9532
|
|
|
|
|
Hi,
Thanks for ur informations.
Its v interesting.
Say, I am a new bee to VB.NET as well as Windows services.
Can u suggest me any resources reg. this.
Thanks
DHARMA.R
|
|
|
|
|
Writing a Windows Service and monitoring the processes list are not exactly newbee projects. But you can search Amazon and checkout the dozens of books on VB.NET for every level from beginner to advanced programmers and cookbooks.
RageInTheMachine9532
|
|
|
|
|
Hi Dave,
Thank u v muc for ur help.
I'll check it out.
Regards
DHARMA.R
|
|
|
|
|
I have a dataset where i display info in a data grib but i would like to show it in textboxes instead, any ideas?
i was thinking
dataset --> a class --> to the textbox
|
|
|
|
|
Are you working on a Windows Form or on a Web Form?
What about the following?
myTextBox.DataBindings.Add(New Binding("Text", myDataSet, "myDataTable.myColumn"))
|
|
|
|
|