how to show a text aside the check box, well, the answer is that it is not possible.
Cool it. I just asked you a question about why you're doing this. There may be an alternative solution to the problem.
It's not impossible, just not doable using the standard controls. You'll have to create your own DataGridViewCheckBoxColumn class to add Text support to it. You'll need to replace the painting code with your own implementation, and possibly add some new properties to control how you want the cells painted, like checkbox on the left of the text, or on the right, among others...
You can check out this[^] example for a start. You'll notice that doing something like this can be very tedious and difficult to get every detail in the drawing code correct.
I'm currently trying to create my own web browser, for fun only. And i have three problems, i don't know how to:
1. Display URL, i'm currently pointing with mouse, in status bar.
2. Display URL (of the link i clicked) in the combobox/textbox.
3. Refresh the page.
In the .net report designer I'm trying keep some text boxes and label from spilling over to the next page. They are located on the bottom of the page but there is a table control above them and if this table control has many rows to display it pushes everthing below it onto the next page. Can I somehow force the textboxes and labels to keep their position?
I am trying to insert some date columns into a MySQL database using vb.net. When trying, I get the error "Incorrect date value: '02/07/2006' for column 'Orderdate' at row 1. MySQL has a date format like YYYY-MM-DD and will not let me insert those dates because of the format. I am inserting text files and the date columns are formatted like MM/DD/YYYY. When I change the data type in the database to varchar, the dates will insert just fine but when I change the data type to date they won't insert in which the date data type is preferred. I have tried so many different things trying to format this including parameterized queries. Any ideas on how to fix this problem?
Here is some code were I tried using the CDate function and got the error "Conversion from string "" to type 'Date' is not valid."
Dont convert it to date then convert it back to string, just leave it as a date object when you insert it into the DateTime column. The database knows what to do with a Date object as well as a correctly formatted Date String object.
The stuff in bold, just leave it as CDate(VariableName). Before you run this command do something like If OrderDate.Trim = "" Then OrderDate = DBNull.Value to insert a NULL value instead of trying to convert a blank value to a date.
I have a rich text box, when I change the font size and type something, everything is ok, then when I hit return and go to the next line the Caret goes back to the default size then when I start to type again it returns to the new font size, how can I get the Caret to stay the same size as the chosen font size.
You've got no control over the caret size in the RTB, or any other standard textbox for that matter.
The reason it's doing this because there is no text on that line with the size of the font your using. It won't change to the new size, as you've found out, until there is something on that line in the new size.
I don't know how your going to change the size of the caret, and more importantly, keep it that size when the RTB is resizing it to what it wants every time the cursor moves.
Does the caret actually change or is it just the spacing that changes. I tried it by setting a large font as the default font. I ran the program and typed some stuff and then clicked a button which altered the selectionfont to a smaller font. When I hit enter the caret was the appropriate height but the space for the line appeared to fit the larger default font. Once I typed something the spacing was set correctly but the issue persisted with every new line I made.
I messed around with overriding wndproc and I think I guessed correctly. I seem to have fixed the issue. You'll have to create your own class that inherits the richtextbox. The fix is a simple one. However, you'll have to use your 'new' control instead of the standard richtextbox. Here is the code. Let me know if you have any issues.
Public Class MyRTB
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = &H444 AndAlso m.WParam.ToInt32 = 1 Then m.WParam = New System.IntPtr(3)
The message is EM_SETCHARFORMAT. I noticed that when you set the Font property for the RichTextBox this message is sent. So I looked for it when I set the SelectionFont property. Sure enough it was sent then as well. I looked for a difference and noticed the messages only differ by the wparam value. A value of 4 was being sent when you set the Font and a value of 1 was being sent when you set SelectionFont. So I figured why not change it and see what happens. I tried a 2 and then a 3. 3 seemed to fix the problem. Although I never fully tested the consequences so some thorough testing should be done.
Maybe try the full path "Inherits System.Windows.Forms.RichTextBox". The fix should work with your extended class. As long as it's a RichTextBox at the heart. All you should have to do is copy and paste the WndProc method.
Last Visit: 31-Dec-99 18:00 Last Update: 26-Sep-23 0:27