Jump to content
Xtreme .Net Talk

karimgarza

Avatar/Signature
  • Posts

    35
  • Joined

  • Last visited

Everything posted by karimgarza

  1. Hi, so what you are tryin to do is to subclass a window in another process? if that is the case, then you need to use Win32 API calls to subclass a specific window. Another way is to use a third party component to help you capture windows messages. I use one called SpyWorks from Desaware. Here is a quote from their website: I hope this information helps you. If you don't want to pay for the component you can always subclass using Win32 API calls. kmg
  2. if you are using a dataset you can get access to the original and current value using: System.Data.DataRowVersion.Current System.Data.DataRowVersion.Original MessageBox.Show("CurrentValue: " + dataSet11.Tables[0].Rows[dataGrid1.CurrentRowIndex][dataGrid1.CurrentCell.ColumnNumber,System.Data.DataRowVersion.Current].ToString()); MessageBox.Show("OriginalValue: " + dataSet11.Tables[0].Rows[dataGrid1.CurrentRowIndex][dataGrid1.CurrentCell.ColumnNumber,System.Data.DataRowVersion.Original].ToString()); I hope this helps, kmg
  3. Hi, The click event of your groupbox does not work when you change it from FlatStyle.Standard to FlatStyle.System because the groupbox does not receive messages for mouse down events when the FlatStyle is set to system. You can see this happening using Spy++. The first image I attached is showing the messages received for a left click using FlatStyle.Standard and the second image shows the messages received using FlatStyle.System, also for a left click. Notice how only when you are setting it to standard is that we receive a message for the left click and not when is on System. I also found from the MSDN documentation that the click event is only supported for compatibility with other areas of the framework: Although this does not solve your problem, it does explain why you click event does not work when FlatStyle is changed to System. Thanks, kmg
  4. Hi, What version of Visual Studio are using? What are the steps you follow to add an icon to your form? Do you use code, the form designer or the App.ico? Give us a little more information about how to recreate your problem. Thanks, kmg
  5. Hi, One of the things that helps me to troubleshoot resources and their names is to use reflector to open the compiled .NET assembly and check for the complete name of the resource that I am trying to load. Most likely the problem is that you are trying to get a resource name that does not exist in the assembly. I included an attachment of an assembly's resource viewed with reflector. thanks, kmg
  6. Hi, What you mean is that you want to be able to see the behavior of the usercontrol you see at runtime at designtime too, right? The only behaviors that I have been able to see at design time are those related to OnPaint, Resize, Location change, etc. I have never seen one for the Mouse Hover event at design time. Have you seen any other third party controls that do this? Thanks, kmg
  7. Hi, I started a little utility that I hope can become something more as time passes by. It is a .NET Add-In for Visual Studio .NET that will help developers when working with datasets, datatables and dataviews. The software will let the developer watch the contents of the previous objects (datasets, dataviews, datatables, etc) in a grid for easy debuging and without to have to build a test forms or go trough Visual Studio's Quick Watch. I would like for people to try it and tell me what they think. here is the link: http://workspaces.gotdotnet.com/DataKwikWatch Thanks in advanced, Karim
  8. nevermind, I already found a way of working around it. Karim
  9. Hi, Anybody that has experience with Add-In's, I would Appreciate your help: I am building an V.S. 7 Add-In and I already have the add-in running but I want to know how to get a reference to an object while in debug mode, I have tried different things : Dim myObject as object If applicationObject.Mode = EnvDTE.vsIDEMode.vsIDEModeDebug Then myObject = applicationObject.Debugger.GetExpression Thanks in advanced, Karim
  10. Add a CreationUser and CreationDate Field to get PrimaryKey Do the following: 1)you are going to add the following two fields to the table (I have it in all my tables) CreationUser and CreationDate. Creation User is a string and CreationDate is a DateTime. Once you have those two fields in the table you want the id from you have to do the following: 2)) Insert the new record the way you were doing it before, but this time include the a username in the username field and the current time (down to the seconds or milliseconds if possible, you can use NOW). 3)Query the table like this for example "SELECT myTableID FROM myTABLE WHERE CreationUser = [myUSER] AND CreationDate = [the date that you created the record with] That is it. This will also help you to mantain a log of Who is inserting rows and at what date and time. if you need me to explain this further do not hesitate to ask. Good Luck, Karim
  11. Does somebody know why I cant drag and drop a datarowview here is the code that Ihave, it shows no errors but it dosen't display the msgbox when the drop is completed any help will be greatly appreciated Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.SqlDataAdapter1.Fill(Me.DataSet11) End Sub Private Sub GridEX1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GridEX1.MouseMove 'exit if no button is pressed If e.Button = 0 Then Exit Sub 'exit if the cursor is inside the control's borders If e.X >= 0 And e.X < GridEX1.Width AndAlso e.Y >= 0 AndAlso e.Y < GridEX1.Height Then Exit Sub End If 'the mouse is beign drag outside 'start the drag and drop operation Dim myDataRowView As DataRowView myDataRowView = CType(Me.GridEX1.GetRow().DataRow, System.Data.DataRowView) Dim data As New DataObject() data.SetData(myDataRowView) 'wait until the drag and drop operation is completed Dim effect As DragDropEffects = DragDropEffects.Move effect = GridEX1.DoDragDrop(data, effect) 'if the operation is a move then delete the row 'If effect = DragDropEffects.Move Then 'Dim myDataRow As DataRow 'myDataRow = CType(GridEX1.GetRow.DataRow(), DataRow) 'myDataRow.Delete() 'End If End Sub Private Sub ScheduleSummary1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ScheduleSummary1.DragDrop ' exit if data is not in the datarowview format 'If Not e.Data.GetDataPresent(System.Data.DataRowView) = True Then Exit Sub Dim myDataRowView As DataRowView If (TypeOf sender Is UserControls.ScheduleSummary) Then myDataRowView = e.Data.GetData("DataRowView", True) MsgBox(myDataRowView("FirstName") + " " + myDataRowView("LastName")) End If End Sub Private Sub GridEX1_QueryContinueDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.QueryContinueDragEventArgs) Handles GridEX1.QueryContinueDrag If e.EscapePressed Then e.Action = DragAction.Cancel End Sub Private Sub ScheduleSummary1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ScheduleSummary1.DragEnter e.Effect = e.AllowedEffect And DragDropEffects.Move End Sub End Class [/Code] Thanks in advanced, Karim
  12. Hi, The same problem you are having happened to me las week. The only way that I was able to display the date and time was to fix line 4 of your code: objReportsTable.Columns("DATEANDTIME").DataType = System.Type.GetType("System.DateTime") to objReportsTable.Columns("DATEANDTIME").DataType = System.Type.GetType("System.String") this has been the only solution that I have Found so far. I do not know how is going to work whenever you want to edit. but try it and see if it helps. Best of Luck
  13. I want to know how can I add the time in one datetime variable to a date in another datetime variable. dim startDate as DateTime dim StartTime as DateTime startDate = startDate + StartTime I would appreciate any ideas as how to do that. Thanks in advanced
  14. My Team and I have created a mapping tool not as perfect as ORM.NET, but we can acomplish the same goals. Our tools create storeprocedures, forms, DataClasses, and Active Reports and is 100% Object Oriented. It took us about 1 month to build them but we are saving a lot of time, What it used to take us three hours now takes us less than one second.
  15. one of the reasons is that you can can validate the configuration
  16. I want to know how I can add the tooltips that provide a description of the methods used when scrolling trough the objects and methods with intellisense. and so that the description also appears in the object browser. Thanks in advanced
  17. as far as objRoutingMaster.All and objWorkCentre.All they need to return a datatable and then you can added it to the same dataset. and then you can add it the following way: dsReturn.Tables.Add(objRoutingMaster.All) dsReturn.Tables.Add(objWorkCentre.All) now if you can't modified the functions to return datatables you can do the following: dsReturn.Tables.Add(objRoutingMaster.All.Tables(0)) dsReturn.Tables.Add(objWorkCentre.All.Tables(0)) or change the 0's for the table name Best of Luck
  18. I think this is the way it works I haven't been able to confirm it: *you can create the function in a module and make them available to alll the files in that project but you can't make them available to other projects. *Unless you create a public class in the module and them from any other project you intantiate the class and use the functions or properties *the other thing you can do is to create a shared class and uase anywhere in your solution given that you have a reference to it in each project. maybe someboy else can confirm this or provide the correct information about modules and how to use the functions Hope this helps and Best of Luck
  19. check out the code and previous answer to question similar to yours http://www.xtremedotnettalk.com/showthread.php?threadid=74698 Best of Luck
  20. thomas, To handle keyboard events only at the form level and not allow other controls to receive keyboard events, set the KeyPressEventArgs.Handled property in your form's KeyPress event-handling method to true. Certain keys, such as the TAB, RETURN, ESCAPE, and arrow keys are handled by controls automatically. In order to have these keys raise the KeyDown event, you must override the IsInputKey method in each control on your form. The code for the override of the IsInputKey would need to determine if one of the special keys is pressed and return a value of true. checkout the following link http://www.codeproject.com/cs/miscctrl/dotnetcolorpicker.asp search for how to override the IsInputKey
  21. Have you tried using transactions to rollback your transaction. You could even use it in a store procedure. checkout this link: http://doc.ddart.net/mssql/sql70/ra-rz_18.htm
  22. checkout this link that says You can also manipulate the items of a ListBox by using the DataSource property. If you use the DataSource property to add items to a ListBox, you can view the items in the ListBox using the Items property but you cannot add or remove items from the list using the methods of the ListBox.ObjectCollection. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsListBoxClassItemsTopic.asp?frame=true
  23. the way you have to do it is the following: *use a dataadapter to bring the data *fill a dataset with the data *set the datasource property of the listbox to the correct dataset such as dataset1.table1 *set the display member to the field you want to display and you are done. if have trouble creating the dataadapter on code use the wizard. Best of Luck
  24. Solution and file included the problem with your code is that you were using two dataadapters: one for the select statement and another for the insert. you need to have one dataadapter for all the operations (delete, insert, add, update) Also you needed to correct the insert command and specify the insert values as parameters. you can see the changes and the comments I left in the code. Best of luck updateadapter.zip
×
×
  • Create New...