|
It depends on the order that the radio buttons were created in the designed generated code.
To "fix" this, just set the default button in your form's Load event, or some other initialization code that sets up a known state.
|
|
|
|
|
Hi
I am not very familiar with shell programming. I am using SHChangeNotifyRegister to be notified of file system changes. Everything works fine except with the SHCNE_CREATE notification when a new file is created.
Then, in this case only, the pidl returned by the function will provide the new file's display name, but SHGetPathFromIDList will not provide the path. I can only guess that in the case of a new file being created, the function only sends a pidl which is relative to the parent folder.
I wondered if anyone knew how I can get from the pidl provided by SHGetPathFromIDList to a fully qualified pidl so that I can retrieve the new file's system path.?
Strangely,when a file is deleted the function does provide a fully qalified pidl from which the path may be obtained.
Public Sub NotificationReceipt(wParam As Long, lParam As Long)
Dim shns As SHNOTIFYSTRUCT
Dim sDisplayname As String
Dim NewName As String
Dim OldName As String
Dim FileData As FILE_DATA
On Error Resume Next
'Fill the SHNOTIFYSTRUCT from its pointer.
CopyMemory shns, ByVal wParam, Len(shns)
If shns.dwItem1 Then
sDisplayname = GetDisplayNameFromPIDL(shns.dwItem1) 'works in all cases
If Len(sDisplayname) Then
OldName = GetPathFromPIDL(shns.dwItem1) 'fails only when lParam SHCNE_CREATE
........................
Else
End If
End If
If shns.dwItem2 Then
sDisplayname = GetDisplayNameFromPIDL(shns.dwItem2)
NewName = GetPathFromPIDL(shns.dwItem2)
If Len(sDisplayname) Then
......................
Else
End If
End If
..................
Any help would be greatly appreciated.
Bertram
|
|
|
|
|
Hello
Transferring settings Pagesetup to printpreview
tks
Fulvio
|
|
|
|
|
Hi..
This is a two step process..
take a print document and assign it the printerSetting and page settings at the place where you call page setup dialog
If PageSetupDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
PrintDocument1.PrinterSettings = PageSetupDialog1.PrinterSettings
PrintDocument1.DefaultPageSettings = PageSetupDialog1.PageSettings
end if
after that use the same page for preview
PrintPreviewDialog1.Document = PrintDocument1
PrintPreviewDialog1.ShowDialog()
this will automatically reflect all the setting in preview window
Good luck
|
|
|
|
|
|
Hello friends i want to copy a fiel in vb6
if u have any idea about it.
i tried filecopy(sourcefile,destination)
but it give permission denied runtime erro 70.
|
|
|
|
|
do you have the permission to copy that file?
If not then its kinda obvious
else i would say try another file
"All your base are belong to us..."
Mr. Cats (2110 A.D.)
|
|
|
|
|
Yes i have the permission
|
|
|
|
|
Then that file is probably either read-only or open by another process.
|
|
|
|
|
Hello guys.I have a problem updating my MS Access from datagrid.
The update button is ther already so I dont need it. I jus need the coding.
Here is what Ive got and I cant geddit correct.Thanx in advance guys.
Protected Sub GridView1_RowUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdatedEventArgs) Handles GridView1.RowUpdated
Dim cm As New OleDbCommand
Dim con As New OleDbConnection
Dim str1 As String = "Provider = Microsoft.Jet.oledb.4.0; Data source =C:\Documents and Settings\Kagisho.Mashiloane.ALFRGIS\My Documents\Visual Studio 2005\Projects\Search AL\TelephoneList.mdb"
Dim str2 As String
con = New OleDbConnection(str1)
con.Open()
str2 = "select * From Extensions"
cm = New OleDbCommand(str2, con)
Dim updateSQL As String = "UPDATE Extension SET Name = @Name, " & "Surname = @Surname, " & "Xtension = @Xtension"
cm.Parameters.Clear()
cm.Parameters.Add("@Name", Name)
cm.Parameters.Add("@Surname", Surname)
cm.Parameters.Add("@Xtension", Xtension)
cm.ExecuteNonQuery()
'Next
lblUpdatemessage.Text = "Update Successfull"
kagiso
|
|
|
|
|
This is just a comment cause a don’t really like doing db stuff in code.
You might wana review your approach to this problem. Placing the connection code inside the row update event is not the best idea.
You should consider using datasets, table adapters etc. to simplify this process.
For example:
1. Form init
2. grid loaded by querying a table adapter in the dataset
3. returned result is passed to .Datasource of the grid
4. grid is refreshed
5a. row changes on the grid are auto reflected on underlying data in the dataset table (not db)
5b. row changes remain in memory
6. once you actually need to write the whole thing to the db use the table adapter's .Update method on the dataset
7. dispose of the form or whatever
Obvious benefits:
1. overhead of connecting to the db every time a row is changed is eliminated
2. simpler implementation allows for greater control and easier maintenance
3. dataset classes can be extended to handle everything themselves with minimal interference
If you have dataset specific questions post them here, members will definitely help you out
"All your base are belong to us..."
Mr. Cats (2110 A.D.)
|
|
|
|
|
|
Good Morning Kagiso,
What the guy is saying is true,i see that you are getting somewhere. you have to create a dataset to Display or save the data in the datagrid, out it this, you dont save the data in the datagrid, but you save the data in the dataset. Create a dataset and one adapter, and fill the dataset and if you want to update, in your Update command of your adapter, use your update commmnd. i have an article that can show you how to do it. Am using a datagrid to save and display the data.its in vb.net, you will just have to convert. and dont forget to vote.
http://www.codeproject.com/useritems/N-Tier_Application_VB.asp[^]
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
i am creating a control datagridview at runtime . and entering column and row names .
I am saving the details of no of columns and rows ,font,borderstyle and normal details in a datatable .
item(col,row).value means i am getting the cell information,
But i am not getting the columns and rows headers here bcoz it doesnot take
-1 . By Which means i can store all these information ?? in a datatable and assing it to back ?
For1206
|
|
|
|
|
You'd have to build some kind of object to store this data in, be it a datatable, or a custom serializable class designed to hold this data. Then you just serialize the instance of the class out to an XML file.
|
|
|
|
|
Hi
I am using inputbox function to set or get the column names and row names of datagridview ,
1) when i call that function it shows the text of particular column or row ,If i make changes or not , then if i click OK it is showing the new name or or old name for datagridview col or row header .
2) When i click Cancel,Then the problem arises ,If there is string in the textbox of inputbox() also it is returning the length of string as 0,Which is setting the column Text or Row text as "" . So How can i maintain the text when the user presses cancel
Any Help in this ....
DVS
|
|
|
|
|
The most basic thing you can do, is simply check the length before you assign the new text to the row or column header.
Current code is probably something like:
NewHeaderText = InputBox("blablabla")<br />
MyDataSet1.Tables(0).Columns(0).ColumnName = NewHeaderText
The alternative would be:
NewHeaderText = InputBox("blablabla")<br />
If NewHeaderText.Length > 0 Then<br />
MyDataSet1.Tables(0).Columns(0).ColumnName = NewHeaderText<br />
End If
This way you catch an empty string, whether the user actually tried this, or whether he pressed cancel.
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
<br />
Dim iActiveCol As Integer = e.ColumnIndex<br />
Dim iActiveRow As Integer = e.RowIndex<br />
If iActiveRow = -1 Then<br />
If TypeOf sender Is DataGridView Then<br />
Dim sColumnName As String<br />
sColumnName = InputBox("Enter Column Name", "ColumnName", CType(ctr, DataGridView).Columns(iActiveCol).HeaderText)<br />
If sColumnName <> "" Then<br />
CType(ctr, DataGridView).Columns(iActiveCol).HeaderText = sColumnName<br />
CType(ctr, DataGridView).ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize<br />
Else<br />
' CType(ctr, DataGridView).Columns(iActiveCol).HeaderText = sColumnName '' Here it is erasing the text if i make it clear the text in inputbox and cancel . <br />
How to handle this one .<br />
<big> Exit Sub</big><br />
End If<br />
End If <br />
End If
Just observere the vb 6.0 adding a new tab There it is perfect how can i ge t that ??
For1206
|
|
|
|
|
The trick is to simply not touch the HeaderText at all, if the value of sColumnName is an empty string.
<br />
If sColumnName <> "" Then<br />
CType(ctr, DataGridView).Columns(iActiveCol).HeaderText = sColumnName<br />
CType(ctr, DataGridView).ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize<br />
Else<br />
Exit Sub<br />
End If<br />
Unless the code you posted is the only code in the sub, in that case you wouldn't even need
<br />
Else<br />
Exit Sub<br />
The code will simply run its course, never affecting the HeaderText of your column.
My advice is free, and you may get what you paid for.
|
|
|
|
|
I FRIENDS
I am receiving the following error on my select statement.
System.InvalidOperationException: Update unable to find TableMapping['Table'] or DataTable 'Table'.
Dim strDateLEvel1 As String
conn = New OleDb.OleDbConnection(connString)
strDateLEvel1 = "SELECT Format([tmpView.StartDate],""dd mmmm yyyy"") AS StartDate, Format([tmpView.StartDate],""dddd"") AS [Day], count(StartDateTime) AS MessageCount" & _
"FROM [SELECT Format([StartDateTime], ""dd mm yyyy"") as StartDate, Format([StartDateTime], ""dddd"") as Day FROM Messages]. AS tmpView" & _
"GROUP BY tmpView.StartDate" & _
"ORDER BY tmpView.StartDate DESC;"
Dim strpersonLevel1 As String
strpersonLevel1 = "SELECT participant AS StartedBy, count(Participant) AS MessageCount" & _
"FROM(participants)" & _
" WHERE(PArticipants.participant <> ""test3@ocs.lcs.local"")" & _
"GROUP BY participant;"
Dim str1 As String = "select * from messages;"
adp = New OleDb.OleDbDataAdapter(str1, conn)
'conn.Open()
Dim dt As New DataTable
Dim ds As New DataSet()
adp.Update(ds)
' AdvBandedGridView1.DataSource = ds
GridControl1.DataSource = ds
please help
Piyush Vardhan Singh
|
|
|
|
|
Piyush Vardhan Singh wrote: Dim dt As New DataTable
Dim ds As New DataSet()
adp.Update(ds)
This is nice. You created a new, empty DataSet, then you tried to Update the database from it. Then you set the DataSource of some Grid control to this empty database.
BTW, these are the only parts of your code snippet that do anything:
conn = New OleDb.OleDbConnection(connString)
Dim str1 As String = "select * from messages;"
adp = New OleDb.OleDbDataAdapter(str1, conn)
Dim ds As New DataSet()
adp.Update(ds)
GridControl1.DataSource = ds
The rest doesn't do anything at all, or isn't used in this snippet.
|
|
|
|
|
|
Did you consider the following options?
1) Uploading it to a File Hosting service and sending a single line download URL instead.
2) Renaming the .EXE as another acceptable file name extension.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I am not to up on gmail but did you try zipping it
|
|
|
|
|
Wow - only in the VB forum.
Zip it, rename the zip ( gmail looks inside zips ) and send it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|