Multicolumn Textboxes - vb.net

In most word processing programs there is a multicolumn option that allows text to overflow from one column into the next. Is there any way to do this using two multiline textboxes or richtextboxes in vb.net?
I have a form that will display a varying amount of data in a textbox, anywhere from 1 to 250 lines. Right now the user can scroll, but I would like to allow the user the option to expand the size of the form, and if the form is wide enough, spill over into a second column to reduce the overall height of the form/reduce the need to scroll.

Related

Access VBA code for copying information from a combobox and pasting into a textbox on a continuous form

Really need help with this, I have a continuous form with a combo box to choose data, each row has a different criteria and you can choose only certain items per row in the combo box drop down. (As an example I have four rows one is a cap, one is a bottle, one is a label and the last is oil to go in the bottle.)
What I need is when I have chosen something in the combo box drop down I want it to paste into a text box and stay there until another choice on the same row is made...... Currently I can make the information appear in the textbox but then when I move to another row and choose anothe item it over writes anything I have already chosen.
So an example would be I have chosen product 1, it has cap 1, bottle 1, label 1 and oil 1. In the drop down combo box I can choose only bottles to replace bottles caps to replace caps and so on. I want to choose bottle 2 in the combo box on the bottle line (Which changes all the combo boxes) I now want to save that choice in the text box on the bottle row only, then when I choose Label 2 on the label row even though it changes all the combo boxes I don't want it to overwrite the text box for the bottle row. (I'm assuming a criteria that will only change the row of the combo box you are clicking on or something like that)
hope this makes sense to every body (P.S. I don't know how to get a screen shot in here so have tried to explain to the best of my ability)
Many thanks
Justin
You have to bind the textbox to a field in the record.
As long as the textbox is unbound, it doesn't know about a record and will display the same for all records.
I'm making the assumption that you want to be able to map some product to 4 different types of caps, bottles, labels, and oil:
It seems that your problem is in your data table design, not in your comboboxes. You shouldn't need the text field at all. The problem is that your comboboxes are all based on the same table. When you select Bottle2 from one of them, it matches the rest of the comboboxes to that row. So all the others will get Label2, Cap2, etc. because they are in the same row of the table.
Make a products table call it tblProducts. The fields ID (autonumber), product_name, label_FK, cap_FK, Bottle_FK, and oil_FK should be in it. Those FK stand for Foreign key and should be a number type. The product name can be text.
Create the tblLabel, tblCap, etc. with an ID, and a description.
In your relationships you need to map the tblLable.ID to the tblProducts.Label_FK field. Do this for all 4 type. Then you can re-create the form based on the products table. Whatever the form gives you for the way to control the label_FK, cap_FK, etc. fields you can convert it to a combobox by right click -> change to...
Finally, you may need to update the number of columns of the comboboxes in order to see the description also.
EDIT: More lasting information -
Doing some solid research on data table design will pay huge dividends in design time. Starting with the Database Design Basics page from Microsoft will help as a decent 30 minute intro and should help clear some things up for you.

Repeat placement of a Label on a form

From what I have seen, if I try to place a label on a form more than once, only the last one is allowed (along with some weird other happenings). I have a form which will have many Textboxes with degree and radian values. Is it possible to somehow use the same Label (or any other control for that matter) more than once so that I do not have to make multiple instances of Π and ° labels to place next to the values in the Textboxes? I realize that this is relatively minor in this instance, but it could have applications later.

Sum numbers in textboxes to a single textbox without button

Ok, I am looking for the code to sum numbers from multiple boxes (2 in this case) and automatically fill another box with the sum without clicking a button or anything. I'm talking about displaying the sum in the third box while numbers are being inputted into the first two boxes. Is this possible? If so, how?
You can subscribe to the TextBox TextChanged events, and update the third text box when the text in either of the first two changes.
Just make sure you handle invalid input carefully (ie: use Int32.TryParse instead of Int32.Parse), as exceptions will likely be raised as the text box values aren't numbers.

How to set the size of DataGridView VB.net

Program http://www.repairstatus.org/program.png
The DataGridView fetches the data from a MySQL server but it does not fill the entire box in size.
Ideally I would like to manually set the table size to fit the box at least width-wise because the rest will fill up once the database is populated more.
Set the property AutoSizeColumnsMode to be Fill. That'll ensure your columns stretch to 100% within your DataGridView. The columns will stretch/shrink when you resize your grid (if your grid is anchored to your form).
Look at the Fill Weights for the Columns.
Specifically, change the AutoSizeMode to Fill.
If trying to expand more than one column, adjust the FillWeight percentage.

Displaying data in DataGridView without HorizontalScroll

My problem is data that load at startup in a DataGridView and a cell containing large data that I want to display on multiple lines instead of horizontalScroll
Multiple lines isn't (easily) supported. You can adjust the Width with Grid.AutoSizeColumnmode and the FillWidth properties of each column.
As an alternative Idea, why not place a multiline textbox near the Grid abd databind that to the specific column? Would show more of the text, but 1 row at a time.