Jump to content
Xtreme .Net Talk

m_oliveira

Avatar/Signature
  • Posts

    40
  • Joined

  • Last visited

Everything posted by m_oliveira

  1. Okay, I got my problem solved after I deployed my app with Crystal merge modules. But now there's another problem, since Crystal modules takes lots of megabytes. Perhaps I should prepare 2 kinds of deployments, the first with Crystal modules, and all of the others without them... Any ideas?
  2. Hello, after I deploy my app in customer computers, I'm getting "Invalid field name" error message every time the app attempts to open a Crystal 9 file. Crystal's Bussiness Objects website says it's a bug fixed w/ either a hotfix or a service pack, but that just don't work. Have one of you ever experienced such an error? Thanks in advance!
  3. Hi, I've tried to test PhysicalMemory property at launch condition, like in the example below: http://www.c-sharpcorner.com/Code/2003/April/SetupProjects.asp In the condition property, I typed in "PhysicalMemory>1000000", then I compiled and deployed the setup, and at test user's desktop the installation proceeded normally. He has only 512MB RAM, and that's why I wanted the installation to stop due to the that condition. What did I do that was wrong? Any ideas? Thanks in advance! Marcelo
  4. Your splitter is left-docked, isn't it? If you decrease the width of your leftmost control(s), your splitter should move to the left automatically.
  5. Perhaps you should override DataGridTextBoxColumn's key events, and see what happens.
  6. Try this: select a1.* from a1 left join a2 on a2.stoptime = a1.stoptime where a2.stoptime is null
  7. Thanks again, Rob!
  8. Thanks for replying, and sorry, I should have written that in a different way. In fact, I need to freeze the leftmost grid column(s) in order to prevent it (them) from scrolling along with the others. Is that possible?
  9. How can I lock datagrid columns? Any ideas?
  10. This might be helpful: http://www.aspfree.com/c/a/.NET/Smart-Cards-in-NET-Part-3/ Marcelo
  11. I forgot to say that you'll have to pass the row number and a font object from your custom DataGridTextBoxColumn to your form through that event, modify the font object based on whether the row number is multiple of 3 and then pass it back to the custom DataGridTextBoxColumn object, that will paint the bolded/not bolded text in your DataGrid. Marcelo
  12. Anyone have a way of doing this? Yes, I have, but unfortunately I don't have enough time to post a sample code. You'll have to subclass the DataGridTextBoxColumn class and trap its Paint event Subs by overriding and overloading them. From inside Sub Paint, you'll raise an event that will be trapped by your windows form. Marcelo
  13. In your ListView's property page, set FullRowSelect = True. Marcelo
  14. Hi, George Strange, System.Windows.Forms.Label class doesn't have a "wordwrap" property. Perhaps you might check Height property of the label in order to find out how many lines it has... Marcelo
  15. Interesting. I didn't know that pending changes could cause such an error. Thanks for the info!
  16. you're right, SendKeys.Send("%{DOWN}") only works with DateTimePicker. But don't worry, you still have two ways to do it with your combo box: SendKeys.Send("{F4}") or MyComboBox.DroppedDown = True
  17. Oh, I think I've chosen ALT+DOWN because I'm addicted to arrow keys... :D
  18. Hi, Mehyar This is probably backwards compatibitity, but it works fine: Private Sub DateTimePicker1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles DateTimePicker1.Enter SendKeys.Send("%{DOWN}") End Sub
  19. PART II Public Class DataGridKeyTrapTextBoxColumn Inherits DataGridTextBoxColumn Event EvHandledTab() Public f As Form = Nothing Private WithEvents _keyTrapTextBox As KeyTrapTextBox = Nothing Private _source As System.Windows.Forms.CurrencyManager = Nothing Private _rowNum As Integer Private _isEditing As Boolean = False Public Shared _RowCount As Integer = 0 Public Sub New() _keyTrapTextBox = New KeyTrapTextBox() _keyTrapTextBox.BorderStyle = BorderStyle.None AddHandler _keyTrapTextBox.Leave, AddressOf LeaveKeyTrapTextBox AddHandler _keyTrapTextBox.KeyPress, AddressOf TextBoxEditStarted End Sub 'New Private Sub TextBoxEditStarted(ByVal sender As Object, ByVal e As KeyPressEventArgs) _isEditing = True MyBase.ColumnStartedEditing(CType(sender, Control)) End Sub 'TextBoxEditStarted Private Sub LeaveKeyTrapTextBox(ByVal sender As Object, ByVal e As EventArgs) If _isEditing Then SetColumnValueAtRow(_source, _rowNum, _keyTrapTextBox.Text) _isEditing = False Invalidate() End If _keyTrapTextBox.Hide() End Sub 'LeaveKeyTrapTextBox Protected Overloads Overrides Sub Edit(ByVal [source] As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer, ByVal bounds As System.Drawing.Rectangle, ByVal [readOnly] As Boolean, ByVal instantText As String, ByVal cellIsVisible As Boolean) _RowCount = [source].Count MyBase.Edit([source], rowNum, bounds, [readOnly], instantText, cellIsVisible) _rowNum = rowNum _source = [source] _keyTrapTextBox.Parent = Me.TextBox.Parent _keyTrapTextBox.Location = Me.TextBox.Location _keyTrapTextBox.Size = Me.TextBox.Size _keyTrapTextBox.Text = Me.TextBox.Text Me.TextBox.Visible = False _keyTrapTextBox.Visible = True _keyTrapTextBox.BringToFront() _keyTrapTextBox.Focus() End Sub 'Edit Protected Overrides Function Commit(ByVal dataSource As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer) As Boolean If _isEditing Then _isEditing = False SetColumnValueAtRow(dataSource, rowNum, _keyTrapTextBox.Text) End If Return True End Function 'Commit Private Sub _keyTrapTextBox_EvHandledTab() Handles _keyTrapTextBox.EvHandledTab If Not IsNothing(f) Then f.SelectNextControl(f.ActiveControl, True, True, True, True) End If End Sub End Class 'DataGridKeyTrapTextBoxColumn Public Class KeyTrapTextBox Inherits TextBox Event EvHandledTab() Public Sub New() End Sub 'New Private Const WM_KEYDOWN As Integer = &H100 Private Const WM_KEYUP As Integer = &H101 Private Const WM_CHAR As Integer = &H102 Public Overrides Function PreProcessMessage(ByRef msg As Message) As Boolean Dim keyCode As Keys = CType(msg.WParam.ToInt32(), Keys) And Keys.KeyCode If msg.Msg = WM_KEYDOWN Then Console.WriteLine(("TextBox.WM_KEYDOWN key: " + keyCode.ToString())) End If ' for a datagrid, we need to eat the tab key oe else its done twice If msg.Msg = WM_KEYDOWN AndAlso keyCode = Keys.Tab Then 'to ignore a message return true without calling baseclass 'to let the textbox handle message return false; 'don't let textbox handle tab keyCode = 0 RaiseEvent EvHandledTab() Return True End If Return MyBase.PreProcessMessage(msg) ' //sample handling code. This lets the textbox handle the delete ' //& preventing (for example) a delete shortcut on a menu getting it ' if((msg.Msg == WM_KEYDOWN) ' && keyCode == Keys.Delete) ' { ' //to ignore a message return true without calling baseclass ' //to let the textbox handle message return false; ' ' //let textbox handle Delete ' return false; ' } 'Return MyBase.PreProcessMessage(msg) End Function 'PreProcessMessage End Class 'KeyTrapTextBox Hope this will help!
  20. Hi Rickarde, I've just been able to do what you want. First, I took the original code from here: http://www.syncfusion.com/faq/winforms/Files/DataGridTextBoxKeys.zip After some editings in the above sample code, I was able to prevent datagrid from tabbing inside its cells. Plus, I added code to select the next form control: PART I Imports System Imports System.Drawing Imports System.Collections Imports System.ComponentModel Imports System.Windows.Forms Imports System.Data Public Class Form1 Inherits System.Windows.Forms.Form Private dataGrid1 As System.Windows.Forms.DataGrid Private myDataSet As DataSet Private WithEvents TextCol As DataGridKeyTrapTextBoxColumn Private components As System.ComponentModel.Container = Nothing Public Sub New() ' ' Required for Windows Form Designer support ' InitializeComponent() SetUp() End Sub 'New Private Sub SetUp() MakeDataSet() dataGrid1.SetDataBinding(myDataSet, "Customers") AddCustomDataTableStyle() End Sub 'SetUp Private Sub MakeDataSet() ' Create a DataSet. myDataSet = New DataSet("myDataSet") Dim tCust As New DataTable("Customers") ' Create two columns, and add them to the first table. Dim cCustID As New DataColumn("custID") Dim cCustName As New DataColumn("custName") Dim cCurrent As New DataColumn("custCity") tCust.Columns.Add(cCustID) tCust.Columns.Add(cCustName) tCust.Columns.Add(cCurrent) ' Add the tables to the DataSet. myDataSet.Tables.Add(tCust) ' Populates the tables. For each customer and order, ' creates two DataRow variables. Dim newRow1 As DataRow ' Create three customers in the Customers Table. Dim i As Integer For i = 1 To 3 newRow1 = tCust.NewRow() newRow1("custID") = (100 * i).ToString() tCust.Rows.Add(newRow1) Next i ' Give each customer a distinct name. tCust.Rows(0)("custName") = "John Summers" tCust.Rows(1)("custName") = "Phil Seagram" tCust.Rows(2)("custName") = "Sam Robinson" ' And address tCust.Rows(0)("custCity") = "Chicago" tCust.Rows(1)("custCity") = "Los Angeles" tCust.Rows(2)("custCity") = "Washington" End Sub 'MakeDataSet Private Sub AddCustomDataTableStyle() 'CType(Me.Container, System.Windows.Forms.Form).SelectNextControl(Me.Container, True, True, True, True) Dim ts1 As New DataGridTableStyle() ts1.MappingName = "Customers" ' Set other properties. ts1.AlternatingBackColor = Color.LightGray ' ' Add textbox column style so we can catch textbox mouse clicks TextCol = New DataGridKeyTrapTextBoxColumn() TextCol.f = Me TextCol.MappingName = "custID" TextCol.HeaderText = "CustomerID" TextCol.Width = 100 'add handler ts1.GridColumnStyles.Add(TextCol) TextCol = New DataGridKeyTrapTextBoxColumn() TextCol.f = Me TextCol.MappingName = "custName" TextCol.HeaderText = "Customer Name" TextCol.Width = 100 'add handler ts1.GridColumnStyles.Add(TextCol) TextCol = New DataGridKeyTrapTextBoxColumn() TextCol.f = Me TextCol.MappingName = "custCity" TextCol.HeaderText = "Customer Address" TextCol.Width = 100 'add handler DataGridKeyTrapTextBoxColumn._RowCount = myDataSet.Tables("Customers").Rows.Count ts1.GridColumnStyles.Add(TextCol) dataGrid1.TableStyles.Add(ts1) End Sub 'AddCustomDataTableStyle Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Dispose #Region "Windows Form Designer generated code" '/ <summary> '/ Required method for Designer support - do not modify '/ the contents of this method with the code editor. '/ </summary> Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Private Sub InitializeComponent() Me.dataGrid1 = New System.Windows.Forms.DataGrid() Me.CheckBox1 = New System.Windows.Forms.CheckBox() Me.TextBox1 = New System.Windows.Forms.TextBox() CType(Me.dataGrid1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'dataGrid1 ' Me.dataGrid1.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right) Me.dataGrid1.DataMember = "" Me.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.dataGrid1.Location = New System.Drawing.Point(56, 24) Me.dataGrid1.Name = "dataGrid1" Me.dataGrid1.Size = New System.Drawing.Size(320, 216) Me.dataGrid1.TabIndex = 0 ' 'CheckBox1 ' Me.CheckBox1.Location = New System.Drawing.Point(16, 48) Me.CheckBox1.Name = "CheckBox1" Me.CheckBox1.Size = New System.Drawing.Size(24, 48) Me.CheckBox1.TabIndex = 1 Me.CheckBox1.Text = "CheckBox1" ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(8, 176) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(32, 20) Me.TextBox1.TabIndex = 2 Me.TextBox1.Text = "TextBox1" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(456, 277) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.TextBox1, Me.CheckBox1, Me.dataGrid1}) Me.Name = "Form1" Me.Text = "Form1" CType(Me.dataGrid1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub 'InitializeComponent #End Region <STAThread()> _ Shared Sub Main() Application.Run(New Form1()) End Sub 'Main Private Sub TextCol_EvHandledTab() Handles TextCol.EvHandledTab Me.SelectNextControl(Me.ActiveControl, True, True, True, True) End Sub End Class 'Form1 END OF PART I
  21. Thanks a lot, donnacha!
  22. Is this your first .NET application?
  23. I have had many troubles while trying to issue sendkeys in previous VB versions. Whenever I wished to move focus to the next control, I used sendkeys("{TAB}"). but now, there is SelectNextControl method, wich is much more reliable.
  24. Perhaps you should create a class that inherits DataGridTextBoxColumn class, and add this functionality to the new class, changing the backcolor property for its textbox hosted control. It must have an easier solution, but I don't know.
  25. guys, Why this thing is sooooooo slow? When I used to program in VB6, I had productiveness. Now, it takes a lot of time just to open an ordinary form designer. I'm getting tired of VB.NET and, as my project grows, it becomes slower and slower. I think it would be better to go back to VB6 and make my life easier... Marcelo
×
×
  • Create New...