|
hi i have written a syntax highlighting program using regex. i selected all the ranges and highlighted one by one.is there anyother fastest way to highlight and my main doubt is if i am intending to type any text or textchange i am able to see the flickering as because i am selecting the particular text and highlighting . could we color particular range of text`s color without selection.(note i am using .net framework 2.0)
with regards
Balagurunathan.B
|
|
|
|
|
The RTB really isn't the best choice for this since performance, no matter you do, will get slower and slower as the length of text gets longer and longer.
But, here's[^] the Google results for "vb.net syntax highlighting richtextbox". You may be disappointed by what you find.
|
|
|
|
|
Hi all,
I working in a project where i want use keypress event in mouse event. So i decided to call Delegates.. But i am getting error...
The Error is in convertion of object to textbox... I give full coding below this.....
Dim myHandler As Windows.Forms.KeyPressEventHandler<br />
<br />
Custom Event myEvent As Windows.Forms.KeyPressEventHandler<br />
AddHandler(ByVal value As Windows.Forms.KeyPressEventHandler)<br />
myHandler = value<br />
End AddHandler<br />
<br />
RemoveHandler(ByVal value As Windows.Forms.KeyPressEventHandler)<br />
myHandler = Nothing<br />
End RemoveHandler<br />
<br />
RaiseEvent(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)<br />
If Not myHandler Is Nothing Then<br />
Me.TextBox1.Invoke(sender, e) Else<br />
End If<br />
End RaiseEvent<br />
End Event<br />
<br />
Sub raise_event()<br />
Dim sender As New Object<br />
Dim e As System.Windows.Forms.KeyPressEventArgs<br />
RaiseEvent myEvent(sender, e)<br />
End Sub<br />
<br />
<br />
Dim d1 As Windows.Forms.KeyPressEventHandler<br />
<br />
<br />
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
d1 = New Windows.Forms.KeyPressEventHandler(AddressOf MyDelegate)<br />
End Sub<br />
<br />
Sub MyDelegate(ByVal sender As Object, ByVal e As Windows.Forms.KeyPressEventArgs)<br />
If Asc(e.KeyChar) = 65 Then<br />
MsgBox("65")<br />
ElseIf Char.IsLetterOrDigit(e.KeyChar) <> True Then<br />
MsgBox(Asc(e.KeyChar))<br />
End If<br />
End Sub<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
AddHandler Me.myEvent, d1<br />
raise_event()<br />
End Sub
Can any one tell where should i change.
Note.
I am using Keypress for Textbox. When i click by mouse the keypress event of the textbox should enable and do the required work
Can any one help me to solve this problem.............
Thank you in Advance
Senthil.S
Senthil S
Software Engineer
|
|
|
|
|
Senthil S wrote: where i want use keypress event in mouse event.
Uhh... what??
From that pile of spaghetti code you posted, it looks like you're trying to fire the KeyPress event of the TextBox when a button is clicked?? Why??
Why not just call the required work method from the Button Click event handler and call the same work method from the TextBox KeyPress event?? You'll reduce all this junk to just two lines of code.
What are you really trying to accomplish with all this??
|
|
|
|
|
how to filter month & year alone from datetime type
Thanks in advance,
Priya.
|
|
|
|
|
How do you mean ? There's properties to access both of those, and you can use a ToString overload to display just those values.
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 )
|
|
|
|
|
i got it by writing such as:
String.Format("{0:MM/yyyy}", DateTime.Now).ToString()
thanks fr ur help
Thanks in advance,
Priya.
|
|
|
|
|
Hi,
I am having MSFlexgrid with some contents from backend. In it at the last column at every row i need to add a checkbox over it. I tried with the following code. Its not throwing error. But i cannot see the checkbox. Please help me. And also i need to write a code when the checkboxes are select and click button it should do some things like "Accept" in backend.
Please help me. Its urgent.
MSFlexGrid1.Rows = rs.RecordCount
MSFlexGrid1.Cols = rs.Fields.Count + 1
Dim i, j As Integer
For i = 0 To rs.RecordCount - 1
For j = 0 To rs.Fields.Count - 1
MSFlexGrid1.TextMatrix(i, j) = rs.Fields(j).Value
If j = rs.Fields.Count - 1 Then
Load Check1(i + 1)
MSFlexGrid1.Row = i
MSFlexGrid1.Col = j + 1
Check1(i + 1).Left = MSFlexGrid1.CellLeft + MSFlexGrid1.Left
Check1(i + 1).Top = MSFlexGrid1.CellTop + MSFlexGrid1.Top
'Check1(n).Width = MSFlexGrid1.CellWidth
'check1(n).Height=
Check1(i + 1).Caption = "check1(" & i & ")"
Check1(i + 1).Visible = True
End If
Next j
Next i
Thanks in Advance,
Regards,
|
|
|
|
|
Please, do NOT repost the same question again less than 24 hours after you already posted it. Have some patience and wait for one of the volunteers around here to get to your question. We all have out own real jobs to do outside of CodeProject.
You can find your answer here[^].
|
|
|
|
|
Question,
I have an inline SQL query that gets the last date from a SQL table. This query stores the retrieved value in a DataTable. How do I bind a Label Control to a DataTable?
I have specified the following but I only get the word "Table".
Label10.Text = Convert.ToString(dt1)
Please help!!
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
Instead of wild guesses, try some research. dt1 is a datatable. So, you probably want to change your code to return a scalar, so you only get one value, but the easiest solution is dt1.Rows(0)(0).ToString()
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 )
|
|
|
|
|
Thank you!
A pleasure as always?
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
Hi, All
I need to zip files programmatically,
Please, any references where I can find any information to zip and unzip
files.
(VB or VB .NET)
Thank you in advance,
Regards
Irfan Siddiqui
VB.Net Developper
|
|
|
|
|
|
|
can you please help me of what code i needed to use in order to send the backed-up file to its destination.thanks
|
|
|
|
|
please explain more...
what you means?
do you mean that you can copy backup file to another directory?
Human knowlege belongs to the world
|
|
|
|
|
Your question is not very clear at all. If you're looking to copy files, the System.Io namespace has what you're looking for, in the File, FileInfo, Directory, and DirectoryInfo classes. You'll find Copy methods on the File and FileInfo classes.
|
|
|
|
|
Yep, unless you mean File.Move("YourFilesCurrentPathAndName", "YourFilesNewLocationPathAndName")
My advice is free, and you may get what you paid for.
|
|
|
|
|
your answer will be a big help
thanks
|
|
|
|
|
Articles always have more info in them than forum replies.
http://www.codeproject.com/KB/cs/tsnewlib.aspx[^]
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 )
|
|
|
|
|
I can't figure out how to add, edit and delete records in my database. whenever I try to add a new user to the database, this message comes out:
The 'Microsoft.Jet.OLEBD.4.0' provider is not registered on the local machine.
.ExecuteNonQuery() won't work..
I read that if your using datasets you don't need to use executeNonQuery.. But I don't know how to use datasets yet i have 'em..
this is the code i did for one adding records. PLease help me figure out what's wrong. I don't know if i have to change my settings on my pc or something's wrong with the code i did..
Imports System.Data.OleDb
Public Class frmUsers
Dim dbCon As New OleDbConnection("Provider = Microsoft.Jet.OLEBD.4.0; Data Source = dbCDNM.mdb")
Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
Dim s As String
dbCon.Open()
If optAdmin.Checked Then
s = "INSERT INTO Users(Username, Password, Lastname, Firstname, MI, Usertype) VALUES('" & txtUsername.Text & "', '" & txtPassword.Text & "', '" & txtLastname.Text & "', '" & txtFirstname.Text & "', '" & txtMI.Text & "', ' Administrator ')"
Dim dbCommand As New OleDbCommand(s, dbCon)
dbCommand.ExecuteNonQuery()
MessageBox.Show("Record Saved")
ElseIf optLib.Checked Then
s = "INSERT INTO Users(Username, Password, Lastname, Firstname, MI, Usertype) VALUES('" & txtUsername.Text & "', '" & txtPassword.Text & "', '" & txtLastname.Text & "', '" & txtFirstname.Text & "', '" & txtMI.Text & "', ' Librarian ')"
Dim dbCommand As New OleDbCommand(s, dbCon)
dbCommand.ExecuteNonQuery()
MessageBox.Show("Record Saved")
Else
MessageBox.Show("You have to select a user type.")
End If
dbCon.Close()
End Sub
End Class
|
|
|
|
|
Best guess, the Microsoft.Jet.OLEDB.4.0 provider is not registered on the local machine. Other possibilities that spring to mind is that the mdb is not in the same folder as your exe, or it needs a username/password, and .NET is giving you a useless error message.
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 )
|
|
|
|
|
|
can you please give me a sample codes regarding backup before logging off or shutting down the computer
|
|
|
|