|
|
hi,
i m developing a text editor. I m using Dhtml edit control rather than richtext box control. My problem is, i wana limit the number of lines in dhtmal edit control. that is i want that a user can enter only 20 lines in dhtml edit control. and after than he has to go on the other page for writing further. so is it possible to limit the number of lines in dhtml edit control. Thx in advance...
King
|
|
|
|
|
Nope. There is no property that exposes this. The DHTMLEdit control is design to edit web pages, not Rich or normal Text.
|
|
|
|
|
thx for reply me.
Can u tell me how i can do the same thing in richtext box control that is if the user writes 20 lines then how can i forces him to further write on the next page. plz reply me..... n thx in advance
King
|
|
|
|
|
What "next page"?? You can handle the TextChanged event of the RTB, check to see how many "lines" (hint: Lines property - the RTB defines a line as a bunch of text with an [ENTER] key on the end, NOT the visual lines on the screen!) then do whatever you want when the number gets to 20.
|
|
|
|
|
thx.
i got your point. Now i m facing another problem in RTB. When i use a image in RTB and try to resize it, the resolution of the image destroyed. Can you suggest anything for solving this problem. I m using DHTMLEdit instead of RTB just becuase of image resolution problem. If you have any solution plz tell me thx man...
King
|
|
|
|
|
I am trying to populate a backup Access Table for specific range of dates; however, the whole table is getting backed up. It works fine with other fields (eg. the commented myCmd statement). Any suggestion will be appreciated
Dim sDate, eDate, cmd As String 'starting date and end date
sDate = DateTimePicker1.Value
eDate = DateTimePicker2.Value
Dim ssdate As Date = DateTimePicker1.Value
'******* Start of Nash-Sutcliffe Efficiency Algorithm ********
'------- Populating dailySummary Table -----
myCmd = "SELECT * INTO dailySummary FROM " & inpTable & " WHERE " & fdate & " > " & ssdate
'myCmd = "SELECT * INTO dailySummary FROM " & inpTable & " WHERE " & obsDaily & " BETWEEN 4.0 AND 5.0"
cmmd = New OleDbCommand(myCmd, myConnection)
MsgBox(myCmd)
cmmd.ExecuteScalar()
|
|
|
|
|
You have multiple problems with this. The first is that your SQL statement is wrong. The WHERE clause is comparing your first date with the second, and alway socmming up with True, so that's why you're getting every record in the table instead of a range of them. You should be comparing the field in the table you want to those two dates, not the two dates to each other.
Second, dates in Access must be wrapped in # characters. You don't have any of those in your SQL string, so the dates are not even valid, no matter what they look like.
Lastly, you're using string concantenation to build the SQL query. This has numerous problems with it as dates in strings can be in many different formats and that might not match the date format Access is using. Use parameterized queries instead. Read this[^] for an explanation of why concantenating strings together to build your SQL statements is a bad thing, and how to use parameterized queries to eliminate some of the problems you're having passing dates into the SQL.
|
|
|
|
|
Hi,
I am wanting to enumerate some registry keys and then retrieve a value and enter something into a listbox or combobox.
For example, I have the following key in the registry HKEY_LOCAL_MACHINE\Software\Test. Under this I have several other sub keys, called for example sub1, sub2 and sub3. In each of these sub keys, I need to retrieve the value of InstallPath string from each of those sub keys, and then put the value into a combobox or listview.
I think I need to enumerate through the subkeys as they can be different, only the main key Test will remain the same.
Any help is appreciated.
Thanks, Andrew.
|
|
|
|
|
Sounds to me like what you really need is a Tree View to show it, not a combo box. If that was me coding it though, I would use a simple while loop to step through the key structure.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
I am trying to find out how to check to see if a control exists (such as a listbox). If it does, then the program wouldn't do anything, if it doesn't, then the program would create it. Does anyone know how to do this or can point me in the right direction?
|
|
|
|
|
Why don't you use a variable to hold the reference to the listbox and set it to Nothing whenever it isn't instantiated?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
You should really be checking for the existance of the piece of data that triggered the control being created, not checking for the control itself.
|
|
|
|
|
Development Environment: Microsoft Visual Studio 2005
Code Behind: VB.net
We created a Class Library.
That Class Library contains some modules and some windows forms.
The assembly of the class library, we referred in a Windows Applications.
In that Windows Application, we have one method that will create the instance for the Class library Form using Activator.CreateInstance method. While creating the Type of the Class Library Form, it is showing the exception as Type Load.
While seeing the exception message, we come to know that the method trying to find the Class Library Form in the Windows application itself.
Please tell me how to access the Class Library Form from Windows Application dynamically.
Please give the solution.
Thanks in advance.
Nagarajan R.J.
|
|
|
|
|
Let's see the code you used to try to create this instance. You've probably missed something very basic in the process.
|
|
|
|
|
I have several no. of records in the database for payroll processing. The Employee Code No. is the primary key and a employeemaster table is connected through coding. When am in the processing screen, if i enter or select the employee code no. the other columns must be automatically filled or a search form that displays info. abt the emp name, desig etc. How to design a search form for this and write coding. Pls help Me?
|
|
|
|
|
- Put the label and textbox that the user can enter EmployeeNo
- Add the Grid for displaying the result.
- Add one button that the user can click for searching..
- In button click event, write the code to query the data from database with filter. And bind it to Grid.
That's all.
|
|
|
|
|
hi S.SRIVATHSAN
i have an Article that has exactly what you want,our friend who jst gave you an advice now, is right, and the article you find Example vb codes
http://www.codeproject.com/KB/vb/N-Tier_Application_VB.aspx[^]
Hope this Helps
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
|
|
|
|
|
<br />
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _<br />
<br />
Partial Class Form1<br />
<br />
Inherits System.Windows.Forms.Form<br />
<br />
'Form overrides dispose to clean up the component list.<br />
<br />
<System.Diagnostics.DebuggerNonUserCode()> _<br />
<br />
Protected Overrides Sub Dispose(ByVal disposing As Boolean)<br />
<br />
Try<br />
<br />
If disposing AndAlso components IsNot Nothing Then<br />
<br />
components.Dispose()<br />
<br />
End If<br />
<br />
Finally<br />
<br />
MyBase.Dispose(disposing)<br />
<br />
End Try<br />
<br />
End Sub<br />
<br />
<br />
<br />
Friend WithEvents CustomerID As System.Windows.Forms.DataGridViewTextBoxColumn<br />
<br />
'Required by the Windows Form Designer<br />
<br />
Private components As System.ComponentModel.IContainer<br />
<br />
'NOTE: The following procedure is required by the Windows Form Designer<br />
<br />
'It can be modified using the Windows Form Designer. <br />
<br />
'Do not modify it using the code editor.<br />
<br />
<System.Diagnostics.DebuggerStepThrough()> _<br />
<br />
Private Sub InitializeComponent()<br />
<br />
Me.Label1 = New System.Windows.Forms.Label<br />
<br />
Me.DataGridView1 = New System.Windows.Forms.DataGridView<br />
<br />
Me.CustomerID = New System.Windows.Forms.DataGridViewTextBoxColumn<br />
<br />
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()<br />
<br />
Me.SuspendLayout()<br />
<br />
'<br />
<br />
'Label1<br />
<br />
'<br />
<br />
Me.Label1.AutoSize = True<br />
<br />
Me.Label1.Location = New System.Drawing.Point(13, 181)<br />
<br />
Me.Label1.Name = "Label1"<br />
<br />
Me.Label1.Size = New System.Drawing.Size(39, 13)<br />
<br />
Me.Label1.TabIndex = 0<br />
<br />
Me.Label1.Text = "Label1"<br />
<br />
'<br />
<br />
'DataGridView1<br />
<br />
'<br />
<br />
Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize<br />
<br />
Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn(){Me.CustomerID})<br />
<br />
Me.DataGridView1.Location = New System.Drawing.Point(16, 12)<br />
<br />
<big>Me.DataGridView1.MultiSelect = False</big><br />
<br />
Me.DataGridView1.Name = "DataGridView1"<br />
<br />
<big>Me.DataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect</big><br />
<br />
Me.DataGridView1.Size = New System.Drawing.Size(240, 150)<br />
<br />
Me.DataGridView1.TabIndex = 1<br />
<br />
'<br />
<br />
'CustomerID<br />
<br />
'<br />
<br />
Me.CustomerID.HeaderText = "CustomerID"<br />
<br />
Me.CustomerID.Name = "CustomerID"<br />
<br />
'<br />
<br />
'Form1<br />
<br />
'<br />
<br />
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)<br />
<br />
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font<br />
<br />
Me.ClientSize = New System.Drawing.Size(284, 264)<br />
<br />
Me.Controls.Add(Me.DataGridView1)<br />
<br />
Me.Controls.Add(Me.Label1)<br />
<br />
Me.Name = "Form1"<br />
<br />
Me.Text = "Form1"<br />
<br />
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()<br />
<br />
Me.ResumeLayout(False)<br />
<br />
Me.PerformLayout()<br />
<br />
End Sub<br />
<br />
Friend WithEvents Label1 As System.Windows.Forms.Label<br />
<br />
Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
'this is the method I'm talking about:<br />
<br />
<big>Private Sub DataGridView1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGridView1.SelectionChanged<br />
<br />
Label1.Text = sender.SelectedRows(0).Cells("CustomerID").Value.ToString<br />
<br />
'last line causes either an ArgumentOutOfRangeException saying 'Index is out of range'<br />
<br />
'or an ArgumentException (see details below)<br />
<br />
End Sub</big><br />
End Class<br />
<br />
<br />
<br />
<br />
Shimi
|
|
|
|
|
Hi Shimi
I am using the following code which works for me
DataGrid_search.CurrentRow.Cells.Item(0).Value.ToString()
Good Luck
|
|
|
|
|
Hi,
I am currently writing an application which in simple terms is used for logging in and out hardware repairs. On one of the forms in this project, I have a data grid view control, two command buttons and a text box. The problem that I am having is that I do not understand how to code a data grid view - I have tried source code from many sites but cannot get my head around it. I have provided a description below of what it is I want the grid view to be populated with. After getting that working, It'd also be great to know how I can filter it using the AutoID number or Serial Number by using the text box and a seperate button each for the serial no or AutoID.
Fields in the table in question: AutoID, DateReceived, Customer, Location, SerialNo, ProductNo, ReferenceNo, ReportedFaults, DateToSym, SymRepeatNotes, SymFaultsFound, SymRepairDescription, SymDateReturned, SymLeopardServices, SymRepeatRepair, DateRepaired, Technician, RepeatRepair, FaultsFound, Notes, ActualRepair, PartsUsed, DateOut, RepairDescription, TotalCharges, BillType, ShipmentDate.
Fields I want shown in the datagrid: AutoID, DateReceived, Customer, SerialNo, ProductNo, ReportedFaults, ActualRepair.
It needs to be filtered by Serial Numnber or Auto ID Number using the method mentioned above.
If anyone could provide me with some sample code, a link to another message on this site, or even build me some code based on what I need with some notes in it, it'd be greatly appreciated.
Thankyou in advance.
Brett.
|
|
|
|
|
brettfk1010 wrote: DataGridView Control in VB6
There's noi such thing as a DataGridView control in VB6. DataGridView didn't show up until .NET 2.0 (VB.NET 2005).
So which is it?? VB6 or VB.NET 2005??
|
|
|
|
|
My apologies
I am trying to use the Data Bound Grid Control or DataGrid Control to do it, whichever is easier.
|
|
|
|
|
I have a DataSet i want to make one cloumn as pivot ...Is there any solutin
|
|
|
|
|
AFAIK, the default one doesn't have that feature.. You probably need to find the third-party one. I wonder why you want to make one column as pivot..
|
|
|
|
|