Rectangular Arrays Of Fixed Size At Runtime
Apr 20, 2011In languages like C++ and Java, it is possible to declare an array of an arbitrary size and then give it a specific size later in the code.
[Code]....
In languages like C++ and Java, it is possible to declare an array of an arbitrary size and then give it a specific size later in the code.
[Code]....
Now all went well about from using the structure correctly. The working of the structure was perfect. How ever i missed Two important issues. The structure needed a fixed size of 10 items (9 in programming terms starting from 0) And also out of the 5 items allowed to be chosen as one of the member types for the structure a limit of 5 items of that particular type.
[Code]...
I have a label which appears full screen on a projector (VGA 2). In this label I will be sending strings. Some one liner's, some wrapped paragraphs. Some multi-line with carrage returns. My goal is to have the font dynamically change size to be as large as possible without overflowing the fixed label size.
View 10 RepliesIf I dim an array to say, 5 elements, should it not fail if I go to add a 6th? I thought this used to require a redim. In .NET 2.0, I have a character array of length = 3. When I populate it from the db, one record had 4 characters in it and it successfully added all 4 characters to the array?
View 2 RepliesHow do I declare a fixed length variable array?[code]...
View 1 RepliesHow do I declare a fixed length variable arra
Structure MyInformation
<VBFixedString(4),System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr,SizeConst:=4)> Public ReturnStatus As String
[code]....
when I click the Open button a file is opened and its items are sorted alphabetically. to do this I have doubled the size of my list. However, when I click the button again to reopen the same file, the items will ADD ON to the previous open-file event even though I have this piece of lstListboxTwo.Items.Clear()(the correct thing is to clear the previous items and add the new ones)So I think this has to do with the new size of my list..I think that I have to set the list size back to its normal size when re-clicking on the button.
Public Class frmForm
Dim List() As String = {""}
Dim count As Integer
[code]....
Private Sub XamMenuItem_DeleteClick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim selectedRowCount As Integer = Grid.SelectionSettings.SelectedRows.Count
If (Grid.Rows.Count >= selectedRowCount) Then
While Grid.SelectionSettings.SelectedRows.Count > 0
[Code]...
above code throws me a "Collection was of a fixed size".
I have subclassed a control that would be vastly better if it was a certain size. At first, I thought I could simply set the height and width in the constructor. That would annoy people, as the control would be placed on the form at some size, and the size would then shift when the program starts, but it doesn't work anyways because the control constructor is called before the size properties are applied to it. Is there a way to fix the size of a control at design time? The only controls that I can think of that don't have the ability to be sized are pretty highly specialized.
View 3 RepliesIs it possible for a richtextbox to have a fixed size? For example, 5 would mean that the richtextbox would only show 5 lines at a time.
View 3 Replies[code]Is there any other solution by which we can initialise the array members using new?
View 5 RepliesI am developing, in VB.Net, an application that reads from text files using a FileStream Object. I do not use a StreamReader, since the buffering it does makes it impossible to use Seek.hose text files form a database, with both index and data files. In index files, all fields are fixed-length, which is not the case in data files.I've recently run into a problem. Since some of my files contain accents, the corresponding characters take more that 1 Byte. Therefore, when I seek in the index file, and offset appears the rest of my index file is not read in the right way
View 4 RepliesI have a gridview which automatically adjusts with the dataset but i want to adjust he size a bit
can any one tell me how to set the column size to a fixed size
I am trying to create and initialize an array of structures of a fixed size. Each struct will be populated when a button is clicked. Here is an example of my struct:
public structure buttonStruct
dim x() as Boolean
dim y() as Boolean
[code]....
In my form_load function I am declaring the array of structs and:
Dim BtnStruct(15) As ButtonStruct
BtnStruct(0).Initialize()
[code]....
Whenever a specific button is clicked, I am trying to collect data and store it in the respective struct and so for example, if button 1 is clicked then I will store the data associated with button 1 into BtnStruct(0). The position of the button is stored in a public variable called BtnNum. If I attempt to store information in the struct inside another function as follows, I receive an error
BtnStruct(BtnNum).x(pos - 1) = temp "btnstruct is not declared. it may not be inaccessible due to its protection level"
I have two datagridviews in my app. They're related. When there is no record in the parent datagridview, I select the "New Row" and then press the Add Button in the child datagridview's bindingnavigator. Then I get that exception:
InvalidOperationException: Item cannot be added to a read-only or fixed-size list.
I know why this happens.When I add new record to child datagridview, parent datagridview's new row loses focus and then delete row. So this error occures.How do I prevent my program from this exception. Remember, it's only occures if there is no record in the parent datagridview.
I would like to take print on pre-printed stationery where I need to fixed up my data in very particular place. Also the paper size is 10 inch by width and 6 inch by height and it is continuous paper which need to be take print from dot matrix printer.
View 1 RepliesI need to limit a Textbox and DataGridView to only enter text in the fixed size of the cell/textbox on the screen. So I have limited the cell/textbox so user can not change it size. Both allow multiline and wordwrap. cell/textbox is sized to accept 5 lines of data (wordwrap or enters) This is like an online form.So the text enter will be printed so I can not allow scrolling in the cell/textbox.
How can I stop the scrolling of the text inside the cell/textbox.
Also : if the user Paste into the cell/textbox how to truncate text if larger than display area.
sample settings:
DataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None
DataGridView1.AllowUserToResizeRows = False
[Code].....
being used to PHP and the easiness of creating arrays with no specific size... I'm hating arrays in VB.
Is there a way I can create an array who's size I won't know?
I'm pulling information out of an XML file and need the information available in another sub - so I'm stashing it in a public array I create at the beginning of the form.
[Code]...
I am very new to vb .net. I want to create a set of arrays of textboxes during runtime of a program. For example when I click on a CommandButton it will ask me how many textboxes do I require as input. Then it will create that no. of textboxes instantly. This thing I have done in Visual Basic 6.0 but I can't do it here in .Net
View 3 RepliesHow can I re-declare arrays in VB.NET at runtime?Example:When I run my program, I will have 100 arrays then I have my button that says "add", if I click it, a text box will appear and I can type there what ever I want to add in my arrays, also I can delete an existing array, but the problem is for example I want to delete an item, and that item is in array number 6, if I delete it, a new item will replace the array, how will I do it?
View 1 Repliesi am in the process of learning myself VB.net (2010 dotnet 4 )And am a litte confused in whats the best way to program what can be called an array.i want to have an array that looks like this,
{{"aap", 1}, {"noot", 2}, {"mies", 3, "boom"}, {"vuur", 4, 7}}
now i tried to declare
[code].....
Working with System.Cryptography, I'm noticing that data arrays up to a certain size will either conform to the size of the Initialization Vector (IV) or the size of the Key provided. So with a 48-byte Key and a 32-byte IV, up to around 42 bytes of data will encrypt to 32 bytes and 44+ will encrypt to 48 bytes of data. I've tested this with a variety of data arrays, and it seems to always come out the same... but I have a concern that higher byte values in the original array may result in longer encrypted arrays.
how or whether I can construct byte arrays that will be guaranteed to come out of Encryption at a pre-determined size?
I have a form where I have to use control arrays to create a multiple input form i.e. rather than processing one transaction at a time up to 16 transactions must be processed. The following really havent given me much problems at this moment labels and textboxes. I use a for construct to create all the controls including a combobox. This is where my question comes in this form combobox has to be linked to a table in a database. But furthermore and this is where it gets complicated for me anyway each seperate combobox must move independly if i select row 5 in the table in combobox 4 combobox 5 which is havent touched should still be on row 1. How do I accomplish this. I'm using a webservice. I have tried passing a loaded dataset . The code that loaded the dataset is as follows
Dim DSInfo As New Project1.localhost4.AccInfo
DSInfo.Credentials = System.Net.CredentialCache.DefaultCredentials
InformationData.Merge(DSInfo.GetBusinessJournals)
[Code].....
this code doesnt however provide a link to the table equallly creating a dataset in the combobox method ,loading it and then setting it as datasource also provides no link. I know i'm missing something.
I have a form with some labels. If the labels equal certain text, then I want the font size of the label to change.For example, if the text reads "apple",I want the font size of the label to be 16.If the text reads "banana", I want the font size of the label to be 8.This has to occur during runtime without any clicking of the label.I have an idea of the code I want to write in order for this to work, but I need to know where to put the code for the labels.I cannot put this under Label_Click or Form_Load.Where can I put this code so that it works for the labels during runtime?
View 2 RepliesI am using the PowerPack and trying to change multiple ovalshape size, I have used the following code for changing multiple labels,
For Count As Integer = 1 To 100
Me.Controls("Label" & Count).Text= "Hello World"
Next Count
If I do the same for OvalShape, assume I have OvalShape1, OvalShape2.... OvalShape100
For Count As Integer = 1 To 100
Me.Controls("OvalShape" & Count).Size = New System.Drawing.Size(20, 20)
Next Count
The above throws error when executed.
I am retrieving Images in a Picture Box at runtime using the following code.
Public Class Form1
Dim myDir As String = "C:Users rujadeDesktop" '-- my folder for images
Dim x, y As Single ' the coordinates of the 'next' image to add
Dim pic As Image
[code]....
I wanted to add more functionality to allow user to increase the size of images that have been retrieved in the Picture Box. How to do so?
I am using vb.net,is it possible to change the size or place of a button at run time.I meant we can click and drag the button to increase the size or move?
View 2 RepliesI have a DataGridView in one of my form which at a certain point I resize an change it's position. I would like to be able to restore it to the designer's default position at runtime. I know I could save it before changing and then restoring it later, but I feel like there surely is a way in .NET to just restore a control position to it's default.
View 2 RepliesI'm making a non-rectangular UI and I've tried different approaches but still can't get the results I want. The following codes are for the user to move the form around.
[Code]....
I'm trying to do a tic-tac-toe console application for practice. I created a case statement for the user to pick which square they want to fill in. [code]...
View 1 Replies