|
My guess is at the moment we aren't on the same page. You said you changed the font...how? Please provide that code so I can see exactly how your doing it. Also any other snippets of code that you think might help. The RichTextBox class you provided works for me. I feel I may not have an accurate picture of what your doing or how your doing it. Please post the code and elaborate/clarify as best you can. Maybe we can figure it out here. If you'd like you can email me your code so I can get a better look at everything. Please send it to KVSJOVEJASMI@spammotel.com. Or if you prefer just email me a link to where I can get it. If you really want to avoid spam check out spammotel.com It's a free simple service I discovered a few years ago. I can definitly vouch for it.
|
|
|
|
|
Thanks for the info, I have now signed up to SpamMotel and will tell other sabout it as well.
|
|
|
|
|
You had me spooked there! It appeared NO messages were being recieved by the richtextbox. I was so confused. Then I noticed it...rtbText is a ExtendedRichTextBox.RichTextBoxPrintCtr. You made a dll. You need to change the code and recompile the dll. I made the change and it worked. Nice program by the way!
|
|
|
|
|
You made a dll
Well no actually it was one that I downloaded from one of the many VB sites.
You need to change the code and recompile the dll.
How is this done? I changed the code and did a rebuild but still nothing happens, but as you did get it to work it's obviously something that I'm not doing, like I said I only downloaded the dll I have not had a lot of dll experience. Using them yes, creating and building them no, maybe I should have a go when this current project is finished.
|
|
|
|
|
Oh, I see. Getting it to work isn't a big deal. I just assumed you had created the dll. What you want to do then is remove rtbText from your application. That control is using the dll which your not going to modify so just remove it. The RichTextBoxPrintCtrl class on your form should appear as a usable control in the toolbox. When I extend a control like that it usually appears under a tab with the name of my application followed by components. For your app I can see the control under "QuickWord Components" which appears at the top of the toolbox. Hopefully you can see the control there. If so just drag it onto your form and rename it to rtbText. Everything should work as though nothing had changed. You may actually have two RichTextBoxPrintCtrl available. So you'll have to make sure you get the right one. Just drop either one onto your form and test it. One should work, the other won't. The other way to make absolutly sure you've got the right control is to add this line to the wndproc method you added to your class.
console.WriteLine(m.ToString) If your using the right control you should see alot of messages in the console window.
|
|
|
|
|
That’s done it
I never thought that after I altered the dll to then reintroduce it on to the form.(It’s always the Obvious!)
Thanks for all your help, understanding and patience, I think it’s fair to say that I’ve learned quite a lot from this thread and I hope others do too.
|
|
|
|
|
i wanna include calculator in one of the button event of VB.net application
but i dnt knw that can v interface our appliaction to OS or not...
please help.
|
|
|
|
|
I can't understand your question, but from what I'm guessing, you want to either write your own calculator app, which isn't that hard, or you can launch the Windows Calculator app using the Process class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
its like i wanna incluede calculator given in windows to my form....
so that whenevr user need its he can get it by simply clickin it..
so that whenevr i click an event of form calculator get open...
can u tell me the procedure of incluiding through process class??
can u meet me online....
my yahoo id is cool_mani_n@yahoo.co.in
-- modified at 14:28 Friday 23rd February, 2007
|
|
|
|
|
manni_n wrote: can u meet me online....
my yahoo id is cool_mani_n@yahoo.co.in
Nope. And noone here will do that. Everything is kept in the forums so other people can learn from it.
manni_n wrote: its like i wanna incluede calculator given in windows to my form....
It's MUCH easier to just launch it and not make it part of your form. If you make it part of your form, just like a textbox or button, the user can move the calculator around your form, and you have no control over it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
and hw that can be launched...?
|
|
|
|
|
Process.Start. As you were told. If you are unable to research how to call a method when you've been told what it is, you need to turn off your computer, and find a job in the fast food industry.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thanks for yr concerned suggestion man...
dnt worry even also there i'll make software for them in dot net only.
|
|
|
|
|
if u want that open windows calculatar, when u click a button. tn use this code
on button click event
Dim Calculator As String
Calculator = Shell("calc.exe", AppWinStyle.NormalFocus)
Thanks & Regards
Form :-
Vikash Yadav
|
|
|
|
|
yeah its workin man....
thanks for your help....
wid regards.....
|
|
|
|
|
we the facility to convert vb into vb.net..
can we do the same from vb.net to vb
please explain the procedure if yes.....
|
|
|
|
|
Why on earth would you want to do such a thing? It can be done. There is no tool in existance that will do it for you though. You have to convert all the code by hand.
You'll also have a problem with all of the .NET Framework classes that the VB.NET code uses since they won't exist in VB6 at all. You'll either have to recreate their functionality in VB6 code (LOTS of work there!), or you can write custom COM wrappers around the .NET Framework classes you need to use in the code.
But, in the second case, if you were to wrap the .NET classes in COM wrappers to call them in VB6, what's the point of even rewriting the code in VB6 in the first place?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello,
I am using Vb.NET
Does anyone have any idea why I am getting the following error at the line where it says: dataAdapter.Update(data, "Caller Records")
Error message is:
Incorrect syntax near 'Records'.
Here is the full code:
Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnupdate.Click
Dim data As New DataSet
Dim dbConn As OleDb.OleDbConnection
Dim dataAdapter As OleDb.OleDbDataAdapter
Dim connectionString As String = "Provider=SQLNCLI;Server=A45292\SQLEXPRESS;DataBase=FSS;Trusted_Connection=Yes"
Dim sqlString As String = "SELECT * FROM [Caller Records] Where RecordNo =" & TextBox2.Text
dbConn = New OleDb.OleDbConnection(connectionString)
dataAdapter = New OleDb.OleDbDataAdapter(sqlString, dbConn)
dataAdapter.Fill(data, "Caller Records")
Dim tbl As DataTable
tbl = data.Tables("Caller Records")
Dim selectedRows() As DataRow
selectedRows = tbl.Select("RecordNo = " & TextBox2.Text)
If selectedRows.Length > 0 Then
selectedRows(0).Item("FirstName") = FirstNameTextBox.Text
selectedRows(0).Item("LastName") = LastNameTextBox.Text
selectedRows(0).Item("CallerPhone") = CallerPhoneTextBox.Text
selectedRows(0).Item("HospitalNumber") = TextBox1.Text
selectedRows(0).Item("Type") = TypeTextBox.Text
End If
Dim myBuilder As OleDbCommandBuilder = New OleDbCommandBuilder(dataAdapter)
myBuilder.GetUpdateCommand()
dataAdapter.UpdateCommand = myBuilder.GetUpdateCommand()
dataAdapter.Update(data, "Caller Records")
MessageBox.Show("Database Is Updated")
dbConn.Close()
programmer
|
|
|
|
|
I think your issue may have to do with your table name of Caller Records. I would change the fill and the call to Tables to just use CallerRecords without the space.
Ben
|
|
|
|
|
Ben,
If name of the table is caller records. What can I use so that space in caller records won't be an issue? I never use spaces when naming but I took this project on and that is how it was.
thanks,
programmer
|
|
|
|
|
In your call to the dataAdapter.Fill just pass the dataset you want to be returned. YOu have to leave the correct table name in the sql query. Then when you access the tables, if you know you are only getting one table back you just need to access Tables(0)
Anyway, I hope that helps.
Ben
|
|
|
|
|
if I do what you are suggesting, I am getting different errors.
thanks for your help.
programmer
|
|
|
|
|
I told you before, you don't need all this code.
You're unncessarily reading the database into a DataSet, selecting the records that you've already selected in the SQL SELECT statement, modifying the data and (trying to) write the data back. You don't have to do this.
Here a hint for the SQL statement you should be using:
UPDATE [Caller Records] SET FirstName=@FirstName, LastName=@LastName,
CallerPhone=@CallerPhone, HospitalNumber=@HospitalNumber,
Type=@Type WHERE RecordNo=@RecordNumber
All of the words preceded with an "@" symbol are named parameters that you fill in with the data from your textbox's. You don't have to retrieve anything from the database to do what you want to do.
You can find more information on parameterized queries here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have an application that needs to add listbox items (strings) to an access database, with each item going to a new row in the table.
Each one of these items has a unique id number (autonumber in access) and am getting stuck with it not writing properly to the DB.
Wats the easiest way of going about this? Thanks
|
|
|
|
|
in Access each table has only one autonumber field. Therefore, I assume that you are trying to place the strings in different tables (right?). If your aim is to write these strings in to one table, I suggest you to use a loop and retrieve the strings and then place those to table one by one.
|
|
|
|