|
I have a text box. User can type any number of characters in that text Box.
After typing 20th character, a window should pop up and all the characters in the text box should transfer to that window. On click of a button present on the newly opened window, entire text in the window should transfer to that text box again... Please help me.. I am a beginner and very new to javascript and VB.net
|
|
|
|
|
shyamts wrote: I am a beginner and very new to javascript and VB.net
Then this is far too complex a task to set yourself. You should work on some more straightforward things until you understand the two languages, which are very different.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
shyamts wrote: a window should pop up and all the characters in the text box should transfer to that window
This is "Day 1 - Java 101" class type stuff. It's quite possbily one of things you teach you on Day 1 of any Java class. I think you really need to pick up a book on Java and start teaching yourself before you attept to put an application together and frustrate yourself out of a job.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hello,
I have problem that i am creating many object of a user control that is in a parent form.
So when I click delete on the user control it doesn't know which object it should raise the event for.
Normally if i add 5 objects of the user control at run-time, if i click delete on the 5th it will raise the event. However, if I click any of the other 4 will will not raise the event.
The way my program works is that I have a tab control on the parent form. The user will click add and the object that will be created on each of the tabs. if i want to delete one object of the user control on the tab it will only work if is the last one i added.
Is there any solution to this problem?
<br />
Public Event DeleteStatus(result As Boolean)<br />
<br />
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click<br />
Try<br />
Dim rowsAffected As Integer = 0<br />
rowsAffected = Me.TA_IncidentTask1.DeleteTask(_taskID)<br />
If (rowsAffected = 0) Then<br />
RaiseEvent DeleteStatus(False)<br />
Else<br />
RaiseEvent DeleteStatus(True)<br />
End If<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message)<br />
End Try<br />
End Sub<br />
Many thanks for any help with this,
Steve
|
|
|
|
|
steve_rm wrote: ByVal sender As System.Object
This is the object that raised the event.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
With dynamically created controls, you have to manually wire up all the events you want to handle using AddHandler and RemoveHandler[^].
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
In an AJAX application there is often a noticeable pause between the time the browser makes a network request and the time the browser receives a response. To let the user know that the network conversation is taking place, the ASP.NET AJAX UpdateProgress control provides immediate feedback by displaying an animated image, ‘loading’ text, or other HTML that disappears once the network response is received.
Is there a way to implement the same concept on windows application using VS2003?
I have tried to use a gif image but when the form is busy(4 exmaple uploading a file) the gif is loosing focus and is not visible during this period.
|
|
|
|
|
samerh wrote: Is there a way to implement the same concept on windows application using VS2003?
Of course, the main thing is, you need to perform your actions on another thread, so your UI remains active.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for your reply, but suppose i dont want to use multi-threading!!!
I want the user to wait until the process ends, but during that time i want to display an image or html that notifies that the form is still active and it is a matter of seconds and the process ends.
|
|
|
|
|
samerh wrote: Thanks for your reply, but suppose i dont want to use multi-threading!!!
You can call Application.DoEvents regularly and hope that it's enough, but if your UI does anything for a long time ( such as waiting for a file to download ), then you have no choice. You can have frozen UI, or you can use threads.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
1) How to get a list of all drive letters and names, including USB-memory sticks, eg. "D: Removable drive"?
Am I right that every drive has an individual ID-number or name? If so, how to get this name/ID from vb.net? I would like to compare if the two USB sticks are the same when used one after the other in the same USB-port.
2) What code snippet would tell my app to make "foo.exe" start on every Windows log in?
3) Is there an API to compress a folder into a zip-file or is the only way to use some 3rd party command line application?
|
|
|
|
|
1 - The System.IO namespace has a class that returns a list of all drives. All drives do have a semi unique ID/name, that would require WMI. They can have a name given to them when formatted, .NET can see that, I suspect most USB drives wouldn't have it.
2 - none, as your app would not be running. Put a shortcut to foo.exe in the run registry key ( I search for runonce, to find it, it's the first one above ), or in the Startup folder of the start menu
3 - are you using .NET 2.0 ? If so, there is zip support in the framework.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
1. Yes, I am using .NET 2.0. How to use this zip support. Could you give me an example code to zip folder and all its subdirectories in "C:\temp\" to folder "D:\here" with the file name "myfold.zip".
2. How to make a registry entry for the startup? Could you give me an example code.
|
|
|
|
|
So, what would be the best way to recognize if the inserted USB memory stick / USB hardrive is the same as the one used before?
|
|
|
|
|
This is used to detect when someone inserts or removes a USB drive, cd or dvd, provising plug and play is still on. It also tells you what kind of drive is used so I hope this can point you in the right direction or at least allows you to snip bits out.
<br />
Private Const GWL_WNDPROC As Long = (-4)<br />
Private Const WM_DEVICECHANGE As Long = &H219<br />
Private Const DBT_DEVNODES_CHANGED As Long = &H7<br />
Private Const DBT_DEVICEARRIVAL As Long = &H8000&<br />
Private Const DBT_DEVICEREMOVECOMPLETE As Long = &H8004&<br />
Private Const DBT_DEVTYP_VOLUME As Long = &H2 ' Logical volume<br />
Private Const DBT_DEVTYP_DEVICEINTERFACE As Long = &H5 ' Device interface class<br />
Private Const DBTF_MEDIA As Long = &H1 ' Media comings and goings<br />
Private Const DBTF_NET As Long = &H2 ' Network volume<br />
<br />
Private Enum DriveType As Integer<br />
DRIVE_UNKNOWN = 0<br />
DRIVE_NO_ROOT_DIR = 1<br />
DRIVE_REMOVABLE = 2<br />
DRIVE_FIXED = 3<br />
DRIVE_REMOTE = 4<br />
DRIVE_CDROM = 5<br />
DRIVE_RAMDISK = 6<br />
End Enum<br />
<br />
Private Structure DEV_BROADCAST_HDR<br />
Public dbch_size As Integer<br />
Public dbch_devicetype As Integer<br />
Public dbch_reserved As Integer<br />
End Structure<br />
<br />
Private Structure DEV_BROADCAST_VOLUME<br />
Public dbcv_size As Integer<br />
Public dbcv_devicetype As Integer<br />
Public dbcv_reserved As Integer<br />
Public dbcv_unitmask As Integer<br />
Public dbcv_Flags As Short<br />
End Structure<br />
<br />
Private Declare Auto Function GetDriveType Lib "kernel32.dll" (ByVal nDrive As String) As DriveType<br />
<br />
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)<br />
If m.Msg = WM_DEVICECHANGE Then<br />
Dim WParam As Int32 = m.WParam.ToInt32()<br />
Dim dInfo As String = ""<br />
<br />
Select Case WParam<br />
Case DBT_DEVICEARRIVAL<br />
dInfo = showInfo(m, WParam)<br />
If Me.advancedMode Then<br />
If MsgBox("New Drive Detected: " & dInfo & vbCrLf & "Would you like to view the images on the drive?", CType(MsgBoxStyle.Question + MsgBoxStyle.YesNo, MsgBoxStyle), "New Drive Detected") = MsgBoxResult.Yes Then<br />
'Me.treeBrowse_ExpTreeNodeSelected(Split$(dInfo, ":")(0) & ":\", )<br />
loadImages(Split$(dInfo, ":")(0) & ":\")<br />
End If<br />
Else<br />
loadImagesUploader(Split$(dInfo, ":")(0) & ":\")<br />
End If<br />
Me.timerRefrshTree.Start()<br />
Case DBT_DEVICEREMOVECOMPLETE<br />
dInfo = showInfo(m, WParam)<br />
If Split$(dInfo, ":")(0) <> "" Then<br />
MsgBox("Drive " & Split$(dInfo, ":")(0) & ":\ Removed", CType(MsgBoxStyle.Information + MsgBoxStyle.OkOnly, MsgBoxStyle), "Device Removal")<br />
Me.timerRefrshTree.Start()<br />
End If<br />
<br />
m.Msg = &H0<br />
End Select<br />
Me.Refresh()<br />
End If<br />
MyBase.WndProc(m)<br />
End Sub<br />
<br />
Private Function showInfo(ByVal m As System.Windows.Forms.Message, ByVal WParam As Int32) As String<br />
Dim infoString As String = ""<br />
Dim Header As DEV_BROADCAST_HDR<br />
Dim HeaderVolume As DEV_BROADCAST_VOLUME<br />
Dim HdrType As Type = GetType(DEV_BROADCAST_HDR)<br />
<br />
Header = CType(Marshal.PtrToStructure(m.LParam, HdrType), DEV_BROADCAST_HDR)<br />
<br />
If Header.dbch_devicetype = DBT_DEVTYP_VOLUME Then<br />
Dim Bits As BitArray<br />
Dim VolumeLetters As New ArrayList<br />
Dim Bit As Boolean<br />
Dim Charcode As Integer = Asc("A"c)<br />
HeaderVolume = CType(Marshal.PtrToStructure(m.LParam, GetType(DEV_BROADCAST_VOLUME)), DEV_BROADCAST_VOLUME)<br />
Bits = New BitArray(BitConverter.GetBytes(HeaderVolume.dbcv_unitmask))<br />
For Each Bit In Bits<br />
If Bit Then<br />
Dim driveLetter As String = Chr(Charcode)<br />
VolumeLetters.Add(Charcode)<br />
Dim thisDrivetype As DriveType<br />
thisDrivetype = GetDriveType(driveLetter & ":\")<br />
If thisDrivetype = DriveType.DRIVE_REMOVABLE Then<br />
infoString = driveLetter & ": Removable Drive"<br />
ElseIf thisDrivetype = DriveType.DRIVE_CDROM Then<br />
infoString = driveLetter & ": CD-ROM"<br />
Else<br />
infoString = driveLetter & ": " & thisDrivetype.ToString<br />
End If<br />
End If<br />
Charcode += 1<br />
Next<br />
End If<br />
<br />
Return infoString<br />
End Function<br />
Daniel
|
|
|
|
|
You can place a shortcut to your app or that exe in the start menu: start->all programs->startup .
or
you can create a value in the registry subkey: HKEY_CURRENTUSER\SOFTWARE\MICROSOFT\WINDOWS\CURRENT VERSION\RUN that references your program.
Posted by The ANZAC
|
|
|
|
|
Has anyone here embarked on this adventure before?
If yes, I would like to hear your experiences since I need to go down that path now.
In any case, can somebody share any tips, tricks or pitfalls related to this type of migration and any pointers as to how the effort estimation might be done?
I am currently evaluating one of the tools that will convert Delphi form files (DFM) to Winforms files. Though there do not seem to be any tools for code conversion.
Thanks
Shreekar
|
|
|
|
|
I would be surprised if such a tool exists, I think you're in rewrite land.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for your reply.
My research also suggests the same thing.
Based on your experience, are there any things that I can do to make my task easier, or some precautions etc.?
Since there does not seem to be much in way of prior experience related to this, I am trying to draw on any parallel or related experiences.
Thanks
Shreekar
|
|
|
|
|
I have no experience, I have never used Delphi, and I refuse to use VB.NET.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I used to work for a company that had all their code in delphi and turbo pascal. The company decided to move to vb.net. SO I have a bit of experience translating delphi to vb.net.
Things that will drive you crazy in vb.net
there are no ; for line delimiters. If you want a line to go to the next line you have to use _ When passing parameters you always have to mark the parameter as byref or byval. You have try catch instead of try except. Any use of pointers is probably not needed anymore. The database stuff is really different and takes some getting used to.
I think the biggest issue is just learning the .net framework. That takes a while. Once you get familiar with it, it doesn't matter if you write the code in vb.net or C# because you know the .net framework. I wrote a little document at one point that talked about common things done in delphi and how to do them in vb.net. I will check to see if I can still find that doc.
Hope that helps.
Ben
|
|
|
|
|
That certainly helps a lot, thanks.
Did you use any tools that could automate atleast some part of the process?
I have come across this[^] tool that converts Delphi forms to Winforms.
That document would be great.
All in all, was that a good/painful experience and did you get the expected benefits in terms of higher maintainability ad improved performance?
I am sorry to raise so many questions, but I am trying to collect as much data as possible.
Thanks
Shreekar
|
|
|
|
|
We did not use any automated tools. In our case the way you do things in .net is different enough that it was probably a good idea to re-write the existing delphi code to better match the new .net structure.
I have looked for that document, it looks like I didn't take a copy of it when I left my previous employer.
It was a good experience to move to .net. Some of the issues we were facing were a lack of people we could hire that had delphi skills. The reality is that there are far more .net programmers out there then delphi. Now that I have been doing .net for 5 or so years, I wouldn't go back to delphi either. I really liked delphi as a product, but it tends to be a little behind the microsoft release. I still remember about 10 years ago where we had to wait almost a year before we could use ado in delphi. Now that delphi has .net that could always perhaps be an option too. Again you don't have a lot of people that will say they know delphi .net
The company I worked for went with vb.net and left delphi behind. I havn't worked there in 2 years, but I would guess most of their delphi code is gone.
The .net framework is great, I think it would be a good move to get on .net
Hope that helps.
Ben
|
|
|
|
|
setup and packaging a windows application using setup wizard or setup project options.
thank u
|
|
|
|
|
I don't see a question ? I mean, it's implicit, but it's kind of rude that you didn't really ask.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|