473,503 Members | 2,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

winform table

27 New Member
Hi !
I want to show a table in the user form
Every line represents the fields of one costumer
The user enters the values for each entry in a line.
I have used :
TableLayoutPanel , and put the buttons in the cells of it.

In the user form, I don't see the table cell borders.
usualy, it is good,
But I wanted the user to see it in a table
my questions are :
1. I have defined the property "cellBorderStyle" (of the TableLayoutPanel) : to single or any other value.
Then it got crazy and started jumping all the time !
Is it a Microsoft bug ? am I doing something wrong ?
2. Is there a better standard way to do it ?
3. a different issue:
I dont want to copy all the buttons from line to line
Will at work with an array of buttons ?
How will I combine it to the code that is generated automaticall ??
Apr 13 '11 #1
4 3451
adriancs
122 New Member
em.. your question is not clear.

what do you mean by

"it got crazy and started jumping all the time !"

what is started jumping? and define "crazy".

Your problem is, the DataGridView won't show up the cell border? and now you want to make it shown?
Apr 30 '11 #2
gilit golit
27 New Member
1. The answer is WindowsGridView

2. all the form screan was jumping. some bug (?). But it is not relevant
May 1 '11 #3
adriancs
122 New Member
**Update Post(2/5/2011):
Hi, I have forgot to add the difinition/declaration of the variable "buttons" in the code below. Please take note of that.
**End of Update(2/5/2011)

If you wish the user to enter values for each entry in a line, using DataGridView is a better choice.

DataGridView is much easier to handle than using TableLayoutPanel.

If you don't want the TableLayoutPanel to resize automatically, you can disable it by this command:

this.tableLayoutPanel1.AutoSize = false;

or you can adjust the grow and shrink properties with this:

this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
or
this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;

This will allow you do add button programatically into TableLayoutPanel, you can do it with this:
Expand|Select|Wrap|Line Numbers
  1. Button button1;
  2.  
  3. // Update(2/5/2011): I have missed out this line
  4. List<Button> buttons = new List<Button>();
  5. // End of update(2/5/2011)
  6.  
  7. void CreateNewButton()
  8. {
  9.     buttons.Add(button1);
  10.     int i = buttons.Count - 1;
  11.     buttons[i] = new Button();
  12.     buttons[i].Click += new EventHandler(buttons_Click);
  13.     buttons[i].Text = "button" + buttons.Count;
  14.     this.tableLayoutPanel1.Controls.Add(buttons[i]);
  15. }
  16.  
  17. void buttons_Click(object sender, EventArgs e)
  18. {
  19.     // Do something
  20. }
May 1 '11 #4
adriancs
122 New Member
Hi, I have forgot to add the difinition/declaration of the variable "buttons" in the code below. Please take note of that.

This line has been added to the code above:

List<Button> buttons = new List<Button>();
May 2 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5562
by: Udi | last post by:
Hi everyone! I have a major problem with the DataGrid control for the Windows Form! I am using the DataAdapter to get data from Sql Server 2000 DataBase and populating a DataGrid with the Table i...
3
2366
by: Elliot Rodriguez | last post by:
Hi: I am writing a WinForm app that contains a DataGrid control and a StatusBar control. My goal is to update the status bar using events from a separate class, as well as some other simple...
8
13689
by: Woody Splawn | last post by:
Lets say I have a winform that is populated with a dataset. The dataset and data table may have several rows in it. Lets say I am looking at the winform and I want to assign a value to a certain...
4
1330
by: robboll | last post by:
Please excuse my ignorance, but I am trying to teach myself .Net without a lot of help. At this point I have created a page with a few text boxes and combo boxes that I am using as an example. ...
7
4287
by: Yavuz Bogazci | last post by:
i have the following problem: my customer wants to show some informations in a WinForm. He has Images and Textelements with are connected. It should look like this: scroll << - ... Image +...
1
2307
by: Jon B | last post by:
Hi All! I would like to make my WinForm DataGrid control so that user could easily edit the items in the **related table**. For instance, I have customers table and it has one-to-many...
1
6636
by: Dale Williams | last post by:
Everyone: Using C#, I'm trying to create a datagrid on a winform programatically. I placed the datagrid and the form and named it CHGrid. Here's the code I'm using: // Get and bind the data....
2
1415
by: J. Clay | last post by:
Developing in VS 2005 I have WinForm app that utilizes several class objects and is databound to a couple of objects. One of the classes uses a timer to query an in memory database every second...
0
1056
by: Bruce HS | last post by:
I'd like my VB2005 code to be able to pass my WinForm Table Adapter to an ancestor object for processing (for instance doing generic logic about saving). However, it looks like Table Adapters...
0
7188
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7063
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7258
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.