|
I am building a control around a RichTextBox control and incorporating a spell checker, but have come across a stumbling block.
If I spell check the text of the RichTextBox Text property, the spell checker finds the errors, but if I use the checkbox RTF property the spell checker then attempts to check the RichText formatting.
If I correct the text in the TEXT property and assign it back to the RichTextBox text property, the RichTextBox loses it formatting.
Any suggestions on how to filter out the spelling mistake and correct them, would be greatly appreciated.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Sometimes it helps to leave things for awhile and the solution just comes to you.
The Spell Checker control I am using (Infragistics) reports the starting position on the incorrectly spelt word and the word itself. So from this information I can select the word in the RichTextBox then replace the selected text with the correct word.
RichTextBox.SelectStartIndex, Word.Length)<br />
RichTextBox.SelectedText = ReplacementWord
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
I made a windows application that connects to a sql server database. It runs on the customer's network. Back at our company I would like to run the application from my desktop but connect to their database. How can this be done?
|
|
|
|
|
You need to be added to the VPN on your customers network. Once you are connected by VPN to their network, just install that app on your machine and run it. That should be all you have to do.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
how i can make a setup wizard for my standart exe project ?
|
|
|
|
|
Add "New Project ..." to the Solution
Select "Other Project Type"
Select "Setup And Deployment"
Select "Setup Wizard"
You will see a setup wizard (1 of 5)
Click Next
You will see a setup wizard (2 of 5)
select "Create a setup for a window application" then click next
You will see a setup wizard (3 of 5)
select "Primary output from Project Name" then click next
You will see a setup wizard (4 of 5)
Click Next
You will see a setup wizard (4 of 5)
click finish
Your setup project is created.
select a Setup Project then right click and then build
your setup is ready to deploy.
|
|
|
|
|
I am working on a VB.net form which got lots of controls on it. On the form I am displaying a listbox control on a button click event and on SelectedIndexChange event of listbox I hide the listbox (pretending as it is a combobox).
I have a problem, Just like a combobox when focus moves to any other control, it becomes to normal mode from expended mode. I want to hide the ListBox on LostFocus event, but ListBox LostFocus event is not being fired until I select an item from the list.
Any idea how I can hide Listbox it looses focus without selecting any item.
Thanks
|
|
|
|
|
Hello,
What I understand from your email is that you may not have set the Focus on the Listbox
while making it visible. Based on my understanding, I created a very basic application
with a ListBox and a button. On Button Click event, I make the List box visible and set
the focus on the control. On the LostFocus event, I set the visibility to false and it
seems to be working.
Here is the code that I have used.
Public Class Form1<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
ListBox1.Visible = True<br />
ListBox1.Focus()<br />
<br />
End Sub<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
Dim i As Integer<br />
<br />
For i = 0 To 20<br />
<br />
Me.ListBox1.Items.Add("Item " & i.ToString)<br />
<br />
Next<br />
<br />
ListBox1.Visible = False<br />
<br />
End Sub<br />
<br />
Private Sub ListBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.LostFocus<br />
<br />
ListBox1.Visible = False<br />
<br />
End Sub<br />
<br />
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged<br />
<br />
ListBox1.Visible = False<br />
<br />
End Sub<br />
End Class
Try setting the focus on the Listbox while making it visible. In case I have misunderstood it, let
me know.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Many thanks for your reply. Well you are absolutely right without setting the focus on listbox, we cannot expect LostFocus to be fired.
Actually I am designing a data entry form with dozens of input controls on in and I am not allowed to use combobox (as per requirement). So I am using a textbox, listbox and a button for the data selection.
With ComboBox, when we click or select any object on form it looses focus automatically and doesn't stay expended anymore. But ListBox fires LostFocus event only when focus goes to any other input control and doesnt fire Lostfocus event when clicking on the form, label or Group box.
Do you have any idea how we can track any mouse click event on the form irresective of any control, so I could hide combo box.
Many thanks
Nas
|
|
|
|
|
I get the unspecified error while connecting to the database.
The Code i wrote for a class is as follows :
Imports System.Data.SqlClient
Public Class Conn
----------------------------------------
Dim con1 As OleDb.OleDbConnection
Dim com1 As OleDb.OleDbCommand
Dim da As OleDb.OleDbDataAdapter
Dim ds As New DataSet
Dim str As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & My.Application.Info.DirectoryPath & "\" & "MyDatabase.mdb'"
----------------------------------------
Public Function ExecuteNonQuery(ByVal SqlQuery As String) As String
con1 = New OleDb.OleDbConnection(str)
com1 = New OleDb.OleDbCommand(SqlQuery, con1)
con1.Open()
Try
Return com1.ExecuteNonQuery
Catch
End Try
End Function
-----------------------------------------
I get the error as 'Unspecified error' at the line
con1.open()
I could not fugure out what is the problem ? could anybody help me out.
Thanks in advance.
Sekhar
|
|
|
|
|
If you put the con1.Open() statement in the try block, perhaps you can get a better error message. Otherwise it could be a number of things. Are you sure your database is in the correct location in your file system? Are you sure your SqlQuery is a good SQL statement? You may also want to put some breakpoints in the code and run in debug...make sure that the values being passed into the function are what you are expecting.
Hope this helps.
|
|
|
|
|
Thanks Kschuler for your response.
I have tried this function from one Form and it is working fine , but when I am calling this from another form then it is showing me the error.
Can you tell what might be the problem ? I had also put the con1.open() statement inside a try catch block but that is also showing me the same error message.
Please Help.
Sekhar
|
|
|
|
|
Maybe your connection is already open. You should replace con1.Open() with this:
If con1.State <> ConnectionState.Open Then<br />
con1.Open()<br />
End If
Also, you should put a Finally block on your try catch, and close the connection after you run an ExecuteNonQuery or an ExecuteScalar. You can use something similar to how you open it, like this:
If con1.State <> ConnectionState.Closed Then<br />
con1.Close()<br />
End If
Some other things I noticed in your code...you're importing sqlclient, but you are not using it, so you probably don't need to import it (unless you are using it in code that you didn't post) Also, you declared a dataadapter object, but you are not using that either (again, unless you just didn't post it)...you also might want to look at disposing objects when you are done with them. For example, once you've used the command object at the end of you function, you could dispose it.
Hope this helps.
|
|
|
|
|
hi all.
I have a panel (container) which has multiple panel controls in it.
How can I get zoom/scroll on the panel - as a group
Also, for the panel, how can I implement panning (using the "hand" to move around?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Hi..
To make panels inside the parent panel u have to do the following
- Put a scroll bar in the parent panel
- Make the max property of the scroll bar as (sum of height of all inner)–(height of parent / container panel)
- Same think can be done for width also if u require
- Now on move of scroll bard u can have the value of scroll bar and keep subtracting/adding in the top value of inner panels
- You can use mouse curser property on panels to show the curser u want
- To move the inner panel with the mouse, store the point when on mouse down
- On mouse move u can find the new point and have what is the difference between mouse down and mouse move new point and move the top and left of the panel accordingly
I am hoping this will help u, just giving logical idea of how do we do it.
Good Luck
|
|
|
|
|
<br />
class CCombObj : public CObject <br />
{<br />
public:<br />
DECLARE_SERIAL( CCombObj )<br />
<br />
class CProCombObj : public CCombObj<br />
{<br />
I have tried to already these codes in derived CObject class to pass to another class but in the same header file. Is there anyone can help me on this topic? I get a bug when the compile.
Error: CCombObj undefined
modified 13-Mar-13 6:01am.
|
|
|
|
|
And this has what to do with VB.NET??
You're probably looking for the Visual C++ forum..
|
|
|
|
|
Hi,
I know there are a lot of articles on this subject, but none of them have concrete solution, so please could you give a small example of one code block which connects to an IP over the internet and sends a file (Asynchronusly) and one code block of a receiver which receives the file. (Asynchronusly)
Thank you!
|
|
|
|
|
How i can know the state of the communication of winsock control in VB.NET ?
Thanks'
|
|
|
|
|
VB.NET has made significant changes to the way these things work, and basically you shouldn't use the WinSock control in .net.... take a look at the System.Net and System.Net.Sockets namespaces instead.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
If we create a dataset then it allocates some meomory . How to deaalocate that memory, if needed?
|
|
|
|
|
Call Dispose on the DataSet object.
myDataSet.Dispose()
|
|
|
|
|
Hello every one
I am using a datagridview to make a billing application
What I am trying to do is on leave event of any cell, multiply amount and quantity cells of the current row and display it in total cell
The issue I am facing is
- it dose not happens as desired when I change any of amount or quantity and move to some other cell
- It works when I change the cell for the second time
Can any one tell me y is it working this way…
|
|
|
|
|
I have a project that sounds similar, and i use the CellValueChanged event of the grid. If that doesn't work for you, try posting your code so we can see what you are doing to help you.
Hope this helps.
|
|
|
|
|
I don't have any idea, may I have some links?
|
|
|
|