|
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"))
|
|
|
|
|
|
i would like to click on the datagrid and display the work in textboxes...
so that dosent work for me
|
|
|
|
|
hi
Please help me how to get the target path of windows shortcut fiels in Visual Basic
Eman Ali Moughal
Senior Software Engineer
Soon Soft (pvt) Ltd
www.soonsoft.com
|
|
|
|
|
hi
Following code will resolve the target path of a shortcut named notepad.lnk in c:\
Change the path accordingly to meet ur requirment.
Dim objFolder As Folder<br />
Dim objFolderItem As FolderItem<br />
Dim objShell As Shell<br />
<br />
Set objShell = New Shell<br />
Set objFolder = objShell.NameSpace("c:\")<br />
<br />
Set objFolderItem = objFolder.ParseName("notepad.lnk")<br />
<br />
If Not objFolderItem Is Nothing Then<br />
Dim objShellLink As ShellLinkObject<br />
<br />
Set objShellLink = objFolderItem.GetLink<br />
<br />
If Not objShellLink Is Nothing Then<br />
<br />
Debug.Print objShellLink.Path<br />
End If<br />
<br />
Set objShellLink = Nothing<br />
End If
rgds..mil10
|
|
|
|
|
Thnks BUddy for the code
but the problem is that this code is not working in VB 6
i think this is the code for VB.NET because in VB 6 FolderItem and Shell does not Exist
would you please help me in this matter
Thanks
Eman Ali Moughal
Senior Software Engineer
Soon Soft (pvt) Ltd
www.soonsoft.com
|
|
|
|
|
hi
I just came back to my desk after Easter vacation. Sorry for the delay.
The code works fine with vb6. But I missed to tell u one thing.
You have to give reference to C:\WINNT\system32\shell32.dll . Give reference to this dll and try.
Rgds…mil10
|
|
|
|
|
HI
Thanks for the reply.
But sorry to bother you again and again
i have some problems related to the code i have added the link to Shell32.dll
so the problem of variables resolve but the function are not working properly
Like
like SET FOLDERITEM = objShell.ParseIFle("c:\") I think this is the function , si this function is not returning the proper directory
I dont know why
woould you please Help me
Thanks
Eman Ali Moughal
Senior Software Engineer
Soon Soft (pvt) Ltd
www.soonsoft.com
|
|
|
|
|
hi
No chance for any mishap, it shud work. Just chk the export list of shell32 using object browser whether those methods are there in the specified class. I tested it on Win2k professional and works fine.
rgds..mil10
|
|
|
|
|
hi
Cool man Thanks Very much the code is working too much file but with a little change i dont know why but the change is
Dim objFolder As Folder2 in the deceleration section.
Because in the Intellisence list their two Folder options one is FOLDER and other is FOLDER2.
Folder2 option contains the procedure PARSENAME() .
Any way thanks very much for the Help
Eman Ali Moughal
Senior Software Engineer
Soon Soft (pvt) Ltd
www.soonsoft.com
|
|
|
|
|
I am trying to put a header on each of my columns in my data grid. I am getting an error while trying to run it. It is telling me that
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
The error is on the first line in this part of the code.
What am I doing wrong? I have a total of 6 columns. Any suggestions.
dgPayrollInfo.GridColumnStyles(0).HeaderText = "Employee ID"
dgPayrollInfo.GridColumnStyles(0).Alignment = HorizontalAlignment.Center
dgPayrollInfo.GridColumnStyles(1).HeaderText = "Payroll ID"
dgPayrollInfo.GridColumnStyles(1).Alignment = HorizontalAlignment.Center
dgPayrollInfo.GridColumnStyles(2).HeaderText = "Pay Date"
dgPayrollInfo.GridColumnStyles(2).Alignment = HorizontalAlignment.Center
dgPayrollInfo.GridColumnStyles(3).HeaderText = "Gross Pay"
dgPayrollInfo.GridColumnStyles(3).Alignment = HorizontalAlignment.Right
dgPayrollInfo.GridColumnStyles(4).HeaderText = "Withholding"
dgPayrollInfo.GridColumnStyles(4).Alignment = HorizontalAlignment.Right
dgPayrollInfo.GridColumnStyles(5).HeaderText = "Net Pay"
dgPayrollInfo.GridColumnStyles(5).Alignment = HorizontalAlignment.Right
Thank you,
ibok23
|
|
|
|
|
I am trying to get the caption/title string of a hidden window, which is bascally a cmd.exe running in the background (not visible on screen). But using GetWindowText() function, I get an empty string back.
If I make that cmd.exe window visible, then it extracts the right caption of that window.
Any idea on what should I use if I have hidden process running in background to get its caption/title bar??
Many Thanks.
|
|
|
|
|
hi
If GetWindowText returns empty string then it means that the window does not exist at all. GetWindowText will return the exact caption even if the window is invisible. So if GetWindowText returns NULL then either the window does not exist or the window doesn't have a caption.
Use Spy++ ( comes with visual studio ) to inspect all active windows and processes.
rgds..mil10.
|
|
|
|
|
OK, I dont know but it doesn't work for me .
If you like, I can send you my code.
Anyways, any idea on how to get only hidden processes listed in VB?
Thanks.
|
|
|
|
|
Hi
I just back to my machine 2day morning ,after easter vacation.
Ok u send me the code. i shall try it out. to get all running process details try thr following.
Call TerminateProcess to terminate a process. This needs the process handle as input. Call OpenProcess to get the process handle. This needs processId as input. Call Process32First and Process32Next to loop thru the running process and to get the ProcessId. Call CreateToolhelp32Snapshot before calling Process32First .
sample code is available on msdn.
rgds..mil10
|
|
|
|
|
The following is the way to put the button and also add the functions for ConnectButton and DisconnectButton when those buttons are pressed.
however, whenever press one of button two functions will be executed instead of only the one with pressed but both of them. Why is that?
Dim WithEvents ConnectButton As CommandBarButton
Dim WithEvents DisconnectButton As CommandBarButton
' Connection Button
With ConnectButton
.Style = msoButtonIconAndCaption
.Caption = "Connect"
.FaceId = 19
.ToolTipText = "Press me for fun and profit."
'.OnAction = "ConnectButton"
.Tag = "My Big Button"
End With
'Disconnection Button
Set DisconnectButton = _
.Add(msoControlButton)
' Disconnect Button
With cbcDisconnectButton
.Style = msoButtonIconAndCaption
.Caption = "disconnect"
.FaceId = 19
.ToolTipText = "disconnect from iims"
'.OnAction = "DisconnectButton"
.Tag = "My Big Button"
End With
|
|
|
|
|
You're supplying the wrong code. What you should be looking at is the tail end of the Click handler functions for each button. Does they say something like this:
Private Sub ConnectButton_Click( ... ) Handles ConnectButton.Click, DisconnectButton.Click
What you problem is is two functions are handling the Click event for one button. Make sure that you don't see two event tags, or the wrong event tags at the end of the function declaration.
RageInTheMachine9532
|
|
|
|
|
>You're supplying the wrong code. What you should be looking at is the tail >end of the Click handler functions for each button. Does they say something >like this:
thanks i didn't have anything at the back of function name just
Private Sub ConectButton_Click()
{
..
}
so that's why, right. I only need to do is to put this handles statement
in order to get it work for each event.
Thanks for your help.
Shiny
|
|
|
|
|
With a ComboBox, I can write ComboBox1.DroppedDown = true.
How can I do the same with DateTimePicker?
Thank you,
Dino
Dino Buljubasic
|
|
|
|
|
With a ComboBox, I can write ComboBox1.DropDown = true.
How can I do the same with DateTimePicker?
Thank you,
Dino
Dino Buljubasic
|
|
|
|
|
Hi, I'm having the same problem. Did you solve this?
/=/=/=/= Sagmam =\=\=\=\
|
|
|
|
|
|
Some time ago I developed a custom control in a Class Library project. It has worked flawlessly, but over the weekend, as I was trying to deploy my application, It suddenly started giving problems. When ever I open the solution which references the custome control, I get a build error "Specified cast is not valid".
I can still build the application and it works fine, but the design view of the custome control won't open. I get the same error message on the [Design]tab. I also tried to close the form and reopen it. The same thing happens. I have tried removing the custome control and re-adding it (and the reference to it) to the solution, but that doesn't help. I'm not even sure whether the problem is in the custom control or in the project that reference it.
Help!
|
|
|
|
|
So yeah, I need some help. I want to create a sub that will allow me to select a source file, select a destination text (.txt) file, and write to that text file the code neccessary to programatically create the source file.
Why would I do such a ludicrously convoluted thing, you ask?
1) I need to create programs that automatically detect whether or not there is a certain file in the root folder, and if that file doesn't exist, I want it to create the file (i.e. a ReadMe file, usually an HTML file).
2) Since they are usually HTML files and I know squat about HTML, it would be easier just to create the file (using OpenOffice.Org in my case), and automate the arduous task of retrieving the HTML source.
3) I don't really have a third thing, but I felt three was the neccessary number of topics to address, and figured it'd be lame to stop at two.
Here's what I have so far:
Public Sub FileCopyCode()<br />
'Declaring variables<br />
Dim FileOpen As OpenFileDialog<br />
Dim SourcePath, OutPath As String<br />
Dim FileSave As SaveFileDialog<br />
Dim SourceFile As System.IO.File<br />
Dim SourceWrite As System.IO.StreamWriter<br />
'Starting the procedure<br />
FileOpen.ShowDialog()<br />
SourcePath = FileOpen.FileName<br />
FileSave.Filter = "Text File|txt"<br />
FileSave.ShowDialog()<br />
OutPath = FileSave.FileName<br />
SourceWrite = SourceFile.CreateText(OutPath)<br />
Dim SourceRead As System.IO.StreamReader<br />
SourceRead = SourceFile.OpenText(SourcePath)<br />
'Now, if I could just set up a loop starting here...<br />
'::Count number of lines in source file, loop following_<br />
'_procedure that many times::<br />
SourceWrite.WriteLine("FilePut(1, " & SourceRead.ReadLine)<br />
'...and ending about here, then maybe I could copy_<br />
'_each line with the FilePut thing in front, and boom! I'd have_<br />
'_what I want<br />
End Sub 'How to programatically create a text file containing the <br />
'_VB.Net code neccessary for recreating a different file programatically<br />
Any help is appreciated, thanks.
As I sit here, I contemplate the last words of Socrates: "I drank what?".
|
|
|
|
|
...
so u want to make a sub which will create a text file. this text file it creates must include the text (code) which is required to create a text file...?
doesnt seem hard, i can help you out. i just dont want to go do this and not be what is requested.
------------------------
Jordan.
III
|
|
|
|