|
I was looking for this to.
Thanks this helpt.
Can I also with some api add or modify the icons at the right side of the titlebar. It would be nise when I add or remove a menu option I also add/remove complete the icon at the right side
Jan
|
|
|
|
|
|
|
|
For those utterly interested in the topic, all you have to do is excelObj.IgnoreRemoteRequests = True and handle for when application closes / windows closes to save and quit excel.
|
|
|
|
|
is it possible to search or look any character or phrase within the file..
like what google search engine do?
hope you can give me some hint about this..
thank you so much
jyn
|
|
|
|
|
Read the entire file into a string and use the string functions.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I want to use a combobox in Datagrid.
and in that combobox i want to display data from database with coding not from its property datasource.
Pls give me reply
|
|
|
|
|
neha.lad wrote: in that combobox i want to display data from database with coding not from its property datasource
Well don't bind it, just populate it in code then.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ok have a simple datagridview well at Least I thought so.... its bound to a typed dataset, it does not do what its supposed to do, when I edit a cell in the row just above the new row line at the bottom and hit ENTER it creates a new bloody row but not really it only actualy creates the new row if I type something, I only wanted to edit the cell I was just in, but now eveytime I change a cell and hit enter it tries to validate the new row with no input in it after it has updated the database, how the hell do you get arroud this, also previuosly, one of my other problems was I would edit a cell and then on CellEndEdit I wanted it to update the database but it would not really run the update I stepped through the code and could see the data in the cell had changed and the tableadapter.update had run but no change to the DB at All, until I edited another cell.
Please if any of you know what is goig on with the first problem of createing a new row on hitting enter in a non new row please assist.
Thanks
<br />
Private Sub TRecieptsTableBindingSource_ListChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ListChangedEventArgs) Handles TRecieptsTableBindingSource.ListChanged <br />
If Me.StockDB.HasChanges Then<br />
Me.UpdatePending = True<br />
End If<br />
End Sub<br />
<br />
Private Sub DataGridView1_RowValidated(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowValidated<br />
If UpdatePending And ValidRow = True Then<br />
Me.TRecieptsTableTableAdapter.Update(Me.StockDB.tRecieptsTable)<br />
Me.UpdatePending = False<br />
ValidRow = False<br />
End If<br />
End Sub<br />
|
|
|
|
|
Sorry, I have no idea, that's because I do not allow in line editing in any grid, I force the user to edit in either a detail panel or another form. The VERY few exceptions to this I only allow editing so the DGV addrows is disabled.
IMHO the management of grid inserting/editing is a bloody nightmare, always has been and I'm not convinced they have it right yet.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yeah I reckon it's the only way that actually works using external forms for editing and adding rows, as the events do not fire as expected, also if I disable the addnewrows and the dataset has only one row the update does not fire on cell_leave or cellendedit at all, and I have to save the changes on an button event, bloody microsoft expect us to use this crap, it diffinatley does not work like it should I have also searched high and low for documentation in the SDK on how to implement a real world working example of the DataGridView that vaildates user input on editing and adding new rows. with no matter how many rows you have or what keystrokes you use to leave a cell and then actually send the update to your database using typed datasets.
|
|
|
|
|
Well actually I never use typed datasets either . I'm afraid I like to manage all the processes myself and am happy to pay the penalty with the additional code to achieve the level of control I require.
All the wizards in MS will never get me to use their built in data tools, they just suck can I be more emphatic, nah! kid sister steps in.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Set AllowUserToAddRows property as false and add a row through code whenever required.
"If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry
|
|
|
|
|
Thanks but I have tried this and it causes another problem if there is only one row in the dataset and you try to edit a cell in that row it does not update the database with the new cell value when you leave the cell as soon as there is a second row it works fine. Any thoughts?
|
|
|
|
|
hi there,
i am trying to check whether the existed folder on disk is readonly or not using vb6.0, i hav done successfuly in case of file i.e. GETATTR("path of foldr) " and vbReadonly but it is nt working in case of folder.
Please help me out
Thanks in advance
i m faisal
|
|
|
|
|
Without seeing the code you used, it's impossible to tell you where you went wrong.
But, you can easily do this with the FileSystemObject and it's Folder object.
Though, I have to question your motivations for using the attributes of a folder. If you're looking to see if the user can create a file in the folder, checking the ReadOnly attribute is not the way to go, since it does not consider the users NTFS permissions.
|
|
|
|
|
Does any one know how to create a windows director using VB code
The below code opens an explorer window to the correct file path, but when try to create a new folder I get an error "Object does not support this property or method"
Any Ideas?
Private Sub Test_Open_Click()
Dim SH, OpenThis, Save_Path
Dim Create_Folder, ThisFolder
SavePath = "c:\Project"
Set SH = CreateObject("shell.application")
OpenThis = SAVE_PATH
SH.Open OpenThis
SH.MkDir (SAVE_PATH & "NewDir")
Set SH = Nothing
End Sub
|
|
|
|
|
There's no such method as Mkdir in the Shell.Application object. it helps to read the documentation on these things instead of just assuming they understand DOS commands.
You're looking for this[^].
|
|
|
|
|
Hi ALL,
I have code in vb.net which is to be converted to VBScript. ow can i do it?
Do we have converter to do it? If so can you please provide me the link plzz ..help me out.
Waiting for reply..... thanks in advance.
Thanks.
|
|
|
|
|
You really cannot do this since VBScript and VB.NET are two different things.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
lostboy241 wrote: I have code in vb.net which is to be converted to VBScript. ow can i do it?
Start rewriting it by hand. THere is no tool that will take VB.NET code and convert it to older VBScript or VB6 code.
|
|
|
|
|
Thank you very much. I'll start doing it. Thanks
|
|
|
|
|
Hi all,
I am trying to send an email from vb.net aplication to an right fax acccount. My email goes to the mail box but the issue is it is not fwd to right fax due to the email-id format. The email format of right fax is
"/name=jhon/fax=1345677777/"<rigthfax@domain.com> when i try to send with this email format everthing looks fine till the send message function is calledin VB.net application. when it reachs to mail box the format changes as follows "/name=jhon/fax=1345677777/ " <rigthfax@domain.com> .The space between the fax number slash and Quotes and the space between the Quotes and less than symbol. How can i change the format of email ID to be normal.
Can any body help me out with this issue?
Waiting for your reply.
Thanks.
|
|
|
|
|
I am trying to write my own System Policy Auditing application for a variety of reasons. At present, I am trying to detect how a system audit logs are configured on a given system. I chose VB.Net because it is what I am most comfortable with. I have tried to do this with RSOP, WMI, ADSI, et al. and the LSA function calls are the only thing that will allow for what I am trying to do.
I am new to Marshaling and copying memory. Below is my code. The problem comes out when I call the LsaQueryInformationPolicy, I get a False result, on a system that I know is configured to audit.
Thanks for any help you can provide!
Imports System.Text
Imports System.Runtime.InteropServices
Public Class LsaUtils
' Import the LSA functions
Private Shared Function LsaOpenPolicy(ByRef SystemName As LSA_UNICODE_STRING, _
ByRef ObjectAttributes As LSA_OBJECT_ATTRIBUTES, _
ByVal DesiredAccess As Int32, _
ByRef PolicyHandle As IntPtr) As UInt32
End Function
Public Shared Function LsaQueryInformationPolicy(ByRef PolicyHandle As UInt32, _
ByRef PolicyInformationClass As UIntPtr, ByRef Buffer As Int32) As UInt32
End Function
Private Shared Function LsaNtStatusToWinError(ByVal NTStatus As UInt32) As UInt32
End Function
Private Shared Function LsaClose(ByVal ObjectHandle As IntPtr) As Long
End Function
Private Shared Function GetLastError() As Long
End Function
' Define the structures
Private Structure LSA_UNICODE_STRING
Public Length As UInt16
Public MaximumLength As UInt16
Public Buffer As IntPtr
End Structure
Private Structure LSA_OBJECT_ATTRIBUTES
Public Length As Int32
Public RootDirectory As IntPtr
Public ObjectName As LSA_UNICODE_STRING
Public Attributes As UInt32
Public SecurityDescriptor As IntPtr
Public SecurityQualityOfService As IntPtr
End Structure
Private Structure POLICY_AUDIT_EVENTS_INFO
Public AuditingMode As Boolean
Public EventAuditingOptions As POLICY_AUDIT_EVENT_TYPE
Public MaximumAuditEventCount As UInt32
End Structure
' Enum all policies
Private Enum LSA_AccessPolicy As Long
POLICY_VIEW_LOCAL_INFORMATION = &H1L
POLICY_VIEW_AUDIT_INFORMATION = &H2L
POLICY_GET_PRIVATE_INFORMATION = &H4L
POLICY_TRUST_ADMIN = &H8L
POLICY_CREATE_ACCOUNT = &H10L
POLICY_CREATE_SECRET = &H20L
POLICY_CREATE_PRIVILEGE = &H40L
POLICY_SET_DEFAULT_QUOTA_LIMITS = &H80L
POLICY_SET_AUDIT_REQUIREMENTS = &H100L
POLICY_AUDIT_LOG_ADMIN = &H200L
POLICY_SERVER_ADMIN = &H400L
POLICY_LOOKUP_NAMES = &H800L
POLICY_NOTIFICATION = &H1000L
End Enum
Private Enum POLICY_INFORMATION_CLASS As Long
PolicyAuditLogInformation = &H1L
PolicyAuditEventsInformation = &H2L
PolicyPrimaryDomainInformation = &H4L
PolicyPdAccountInformation
PolicyAccountDomainInformation
PolicyLsaServerRoleInformation
PolicyReplicaSourceInformation
PolicyDefaultQuotaInformation
PolicyModificationInformation
PolicyAuditFullSetInformation
PolicyAuditFullQueryInformation
PolicyDnsDomainInformation
End Enum
Private Enum POLICY_AUDIT_EVENT_TYPE As ULong
AuditCategorySystem
AuditCategoryLogon
AuditCategoryObjectAccess
AuditCategoryPrivilegeUse
AuditCategoryDetailedTracking
AuditCategoryPolicyChange
AuditCategoryAccountManagement
AuditCategoryDirectoryServiceAccess
AuditCategoryAccountLogon
End Enum
Public Shared Function OpenHandle(ByVal strSystem As String) As Long
Dim winErrorCode As Long = 0 ' contains the last error
' initialize an empty unicode-string
Dim systemName As LSA_UNICODE_STRING = New LSA_UNICODE_STRING
systemName.Buffer = Marshal.StringToHGlobalUni(strSystem)
' Combine policies required to grant/deny privileges
Dim access As Int32 = CInt(LSA_AccessPolicy.POLICY_VIEW_AUDIT_INFORMATION)
' initialize a pointer for the policy handle
Dim policyHandle As IntPtr = IntPtr.Zero
Dim myBuff As IntPtr = IntPtr.Zero
' these attributes are not used, but LsaOpenPolicy wants them to exists
Dim ObjectAttributes As LSA_OBJECT_ATTRIBUTES = New LSA_OBJECT_ATTRIBUTES
ObjectAttributes.Length = 0
ObjectAttributes.RootDirectory = IntPtr.Zero
ObjectAttributes.Attributes = UInt32.Parse("0")
ObjectAttributes.SecurityDescriptor = IntPtr.Zero
ObjectAttributes.SecurityQualityOfService = IntPtr.Zero
' get a policy handle
Dim resultPolicy As UInt32 = LsaOpenPolicy(systemName, ObjectAttributes, access, policyHandle)
'MessageBox.Show(resultPolicy)
If Not resultPolicy.ToString = "0" Then
MsgBox("OpenPolicy failed: " & resultPolicy.ToString, "ServiceUtils")
Else
resultPolicy = LsaQueryInformationPolicy(policyHandle, POLICY_INFORMATION_CLASS.PolicyAuditEventsInformation, _
myBuff)
Debug.Print("Result = " & LsaNtStatusToWinError(resultPolicy))
If resultPolicy = 0 Then
Dim polInfo As POLICY_AUDIT_EVENTS_INFO
polInfo = Marshal.PtrToStructure(myBuff, GetType(POLICY_AUDIT_EVENTS_INFO))
MsgBox(polInfo.AuditingMode & " " & polInfo.MaximumAuditEventCount)
Dim audPolicy As POLICY_AUDIT_EVENT_TYPE = Marshal.PtrToStringAuto(polInfo.EventAuditingOptions)
Dim audRestartShutdown As String = polInfo.EventAuditingOptions
'Dim audLogonLogoff As String
'Dim audObjectAccess = Test(4)
'Dim audUserRights = Test(6)
'Dim audProcessTrack = Test(8)
'Dim audPolicyChanges = Test(10)
'Dim audUserGroupManagement = Test(12)
'MsgBox(audRestartShutdown.ToString)
'MsgBox(audLogonLogoff)
'MsgBox(audObjectAccess)
'MsgBox(audUserRights)
'MsgBox(audProcessTrack)
'MsgBox(audPolicyChanges)
'MsgBox(audUserGroupManagement)
Else
MsgBox("Don't Know")
End If
End If
Dim Help
Help = LsaClose(policyHandle)
MessageBox.Show("Help " & Help)
Return winErrorCode
End Function
End Class
|
|
|
|