|
pdnet wrote: If I am go for "Form1.Save" its working, but after save the focus will be return back to the "Form1",
So the focus is staying in the form that was active? Or do you mean that if you're on form2 and you press save for form1 the focus goes to form1. If that's the case, you most likely set the focus during the save.
pdnet wrote: hen If I doing any activity in my "Child1" it throws an error message "Object reference not set to an instance of the object..."
Didn't quite get what was child1 but I'd guess you store a reference to your form somewhere which is at call time nonexistent.
pdnet wrote: also a strange problem occures in my form after these any event will be called twice
Most likely you have duplicate handlers for those events.
|
|
|
|
|
Hi All,
I have doubt about datagridviewcell. i have created textboxcolumn in datagridview. when ever i click the particular cell that time the cell can change datagridviewcomboboxcell and also i need to add the item in combobox collection and when i go to another cell that time new cell get datagridviewcombobox cell and existing cell can change datagridviewtextbox cell kindly any one help me to do this. advance thanks for your help.
i am a fresher in software development i have so many doubts in .net so i need to ca
|
|
|
|
|
i think you want to select one value from multiple item and fill this item in selected cell. If yes, then create separate ComboBox which visiblity is false and fill this ComboBox with item. Now when datagridvew's cell got focus then place the ComboBox on selected cell location and set it visiblity to True. Now on lost focus event of ComboBox, place ComboBox text to cell and hide the ComboBox
|
|
|
|
|
can you provide the code
i am a fresher in software development i have so many doubts in .net so i need to ca
|
|
|
|
|
Suppose you want to fill the value in column 2 then use CellEnter event of datagridview as follows.
Private Sub dgv1_CellEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgv1.CellEnter<br />
<br />
If e.ColumnIndex = 1 Then<br />
ComboBox1.Visible = True 'comboBox1 is combo box which contains multiple item<br />
ComboBox1.Left = dgv1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, False).Left + dgv1.Left<br />
ComboBox1.Top = dgv1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, False).Top + dgv1.Top<br />
ComboBox1.BringToFront()<br />
<br />
RowIndexForComboHandling = e.RowIndex<br />
ComboBox1.Text = dgv1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value<br />
ComboBox1.Width = dgv1.Columns(1).Width<br />
Else<br />
ComboBox1.Visible = False<br />
End If<br />
<br />
End Sub<br />
and this is the lost focus event of combobox1
Private Sub ComboBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.LostFocus<br />
If ComboBox1.Text.Trim <> "" Then<br />
dgv1.CurrentCell.Value = ComboBox1.Text<br />
End If<br />
dgv1.Focus()<br />
dgv1.CurrentCell = dgv1.Rows(dgv1.CurrentCell.RowIndex).Cells(dgv1.CurrentCell.ColumnIndex + 1)<br />
comboBox1.visible=false End Sub
hope this helps
|
|
|
|
|
Hi All,
I got a requirement, "To retrieve the list of machine names in which a particular user is logged on to,in an Active Directory."
Any suggestions please ..
Thanks & Regards,
Chaitanya.
|
|
|
|
|
You can't find out. AD doesn't track that information.
|
|
|
|
|
Man, would be sweet if it did though
|
|
|
|
|
I have an application which allows the user to select multiple combo boxes and then display data in a datagrid view depending on what is selected in the combo boxes.
However, one of my fields is called 'Fee'. Obviously, this is a decimal value, I am trying to use a combo box to select a range of fees (0 - 150, 151 - 200 etc).
For the other 3 combo boxes on the form, the values are coming from a stored procedure, however, i cannot do this for the 'fee' field because i receive errors when it tries to convert to decimal.
The text in my combo box will be like the example above (0 - 150) but the values in the database are formatted differently (150.00, 170.20).
My question is, how would i be able to filter out results in my datagrid view by using a range on the 'fee' field, i thought about a case statement but at the moment it just brings back a datagrid with 'rowerrors' as a column title.
|
|
|
|
|
You asked this question 2 days ago - did you try what was listed?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I want to extract folder images from folders that contain music albums. These images are shows using the thumbnail view on my explorer. I want to extract them using Visual Basic. I have version 5. I have tried to use shell32 but cannot seem to get it to work. I have seen articles referring to system.icon constructs but I cannot seem to find the correct library on my computer. Any help is appreciated.
Ron C
|
|
|
|
|
The album artwork which is used to generate the folder icon, is stored in the folder containing the music files, as a jpeg image. I believe the image files are hidden by default.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Thanks, but they do not seem to be there. I am displaying hidden files and they do not show.
|
|
|
|
|
I think what you are seeing are album art images stored in the meta-data of the audio file. For example the ID3 tags of an MP3 file can be used to store images of the album cover and such. This stuff is usually displayed on the fly by enumerating the files and then reading their meta-data.
|
|
|
|
|
Thanks.
The files in question are all .wma files. They are much more difficult to parse than mp3 files. I have examined them in raw form and cannot seem to find anything that looks like a jpg or image. Any suggestions?
|
|
|
|
|
hobbitdome wrote: I have version 5.
Scrap it. You can get VB.NET 2008 Express Edition for free here[^].
|
|
|
|
|
Thanks.
I am a little reluctant to switch VB versions unless I can keep the VB5 stuff also. I have a tremendous amount of code developed in VB5 and when I have looked at upgrading, problems always appear (incompatible controls, etc). Can the VB.NET 2008 Express Edition co-exist with VB5 or will it overwrite my controls?
|
|
|
|
|
It'll coexist quite easily, but here's a little motivation. The VB5 and 6 runtimes are not supported under Windows 7.
|
|
|
|
|
Hello Sir/ Madam.
I am using MSComm object in VB.net but it is showing error. if same code working in VB 6.0.
The Code is:
Dim lblErrPort As System.Windows.Forms.Label
On Error GoTo lblErrPort
btnstart.Enabled = False
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
With MSComm1
.RThreshold = 1
.Settings = strbaud & "n,8,1"
End With
If MSComm1.PortOpen = False Then
MSComm1.CommPort = intportno + 1
MSComm1.PortOpen = True
End If
'Timer2.Enabled = True
btnstop.Enabled = True
Exit Sub
lblErrPort:
If Err.Number = 8002 Then
MsgBox("System doesn't having comport : " & intportno + 1, MsgBoxStyle.Critical, "Commport selection")
btnstart.Enabled = True
btnstart.Focus()
ElseIf Err.Number = 8005 Then
MsgBox("comport : " & intportno + 1 & " is already opened.", MsgBoxStyle.Critical, "Commport selection")
btnstart.Enabled = True
btnstart.Focus()
Else
MsgBox("Error Number : " & Err.Number & (Chr(13)) & vbNewLine & "," & Err.Description, MsgBoxStyle.Critical, "Communication starting")
End If
.Settings = strbaud & "n,8,1" Error Line.
If i use Error Handler statement it is showing Runtime Error 380.
If I remove Error Handler statement then it is showing like this
Message: "Exception from HRESULT: 0x800A017C (CTL_E_INVALIDPROPERTYVALUE)"
Error Code: -2146827908
Any one Help me plz
|
|
|
|
|
The error message suggests that you are trying to use some invalid value in the settings. What does strbaud contain?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
strbaud is Global Integer Variable.
This will contain bandwidth. Normally it contain 9600.
|
|
|
|
|
try this....
replace
.settings =strbuad & "n,8,1"
with
.settings = str(strbuad) & ",n,8,1"
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
in my application i want to disable or visible a perticular cell in datagridview in load time the grid by coding
i write just like this
me.gridview1.row(2).cells(4).visible = false
in this coding that give me the error of readonly properity
can i visible or disable to perform in perticular cell please help me in this and give me some example please it's urgant....
|
|
|
|
|
I don't think you can hide a cell, you can hide a row or column and you may have control of enable on the cell.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
As the previous poster said, I don't think you can hide a cell but you can disable it with the 'ReadOnly' property. i.e.
me.gridview1.row(2).cells(4).ReadOnly = true
|
|
|
|