How can I resize a list ? thanks 7 1283
Hi Deniel,
If it's some sort of list Control to which you are referring then:
- for WinForms set any of the Bounds, ClientSize, Size, Width or Height
properties
- for WebControl set the Width or Height properties or add custom attributes
and styles.
--
Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
How can I resize a list ? thanks
class A {
public int a;
}
private void func()
{
List<Aaref=new List<A>();
//dosometing
aref.resize(100 00); <------ This is what i want to do
}
But there is no resize() implemeted.
Thanks for any help
Dave Sexton wrote:
Hi Deniel,
If it's some sort of list Control to which you are referring then:
- for WinForms set any of the Bounds, ClientSize, Size, Width or Height
properties
- for WebControl set the Width or Height properties or add custom attributes
and styles.
--
Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
How can I resize a list ? thanks
Hi Deniel,
List<Twill expand on its own when you add items to the list. You can set
the Capacity, which affects how automatic resizing occurs within the List.
"List<TCapa city Property" http://msdn2.microsoft.com/en-us/library/y52x03h2.aspx
--
Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message
news:11******** *************@m 73g2000cwd.goog legroups.com...
class A {
public int a;
}
private void func()
{
List<Aaref=new List<A>();
//dosometing
aref.resize(100 00); <------ This is what i want to do
}
But there is no resize() implemeted.
Thanks for any help
Dave Sexton wrote:
>Hi Deniel,
If it's some sort of list Control to which you are referring then:
- for WinForms set any of the Bounds, ClientSize, Size, Width or Height properties
- for WebControl set the Width or Height properties or add custom attributes and styles.
-- Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message news:11******* *************** @f16g2000cwb.go oglegroups.com. ..
How can I resize a list ? thanks
Thanks Dave for your answer,
I still wonder how i can sort the list based on the comparison of "a"
values
I mean
private bool comp(A aref, A bref)
{
return aref.a<bref.a;
}
if i put this function in a icomparable, implementation may become
complex,
built-in sort of List can't do this, can it ? How can I make a sort()
then ?
Dave Sexton wrote:
Hi Deniel,
List<Twill expand on its own when you add items to the list. You can set
the Capacity, which affects how automatic resizing occurs within the List.
"List<TCapa city Property" http://msdn2.microsoft.com/en-us/library/y52x03h2.aspx
--
Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message
news:11******** *************@m 73g2000cwd.goog legroups.com...
class A {
public int a;
}
private void func()
{
List<Aaref=new List<A>();
//dosometing
aref.resize(100 00); <------ This is what i want to do
}
But there is no resize() implemeted.
Thanks for any help
Dave Sexton wrote:
Hi Deniel,
If it's some sort of list Control to which you are referring then:
- for WinForms set any of the Bounds, ClientSize, Size, Width or Height
properties
- for WebControl set the Width or Height properties or add custom
attributes
and styles.
--
Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
How can I resize a list ? thanks
Thanks Dave for your help
Dave Sexton wrote:
Hi Deniel,
List<Twill expand on its own when you add items to the list. You can set
the Capacity, which affects how automatic resizing occurs within the List.
"List<TCapa city Property" http://msdn2.microsoft.com/en-us/library/y52x03h2.aspx
--
Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message
news:11******** *************@m 73g2000cwd.goog legroups.com...
class A {
public int a;
}
private void func()
{
List<Aaref=new List<A>();
//dosometing
aref.resize(100 00); <------ This is what i want to do
}
But there is no resize() implemeted.
Thanks for any help
Dave Sexton wrote:
Hi Deniel,
If it's some sort of list Control to which you are referring then:
- for WinForms set any of the Bounds, ClientSize, Size, Width or Height
properties
- for WebControl set the Width or Height properties or add custom
attributes
and styles.
--
Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
How can I resize a list ? thanks
Hi Deniel,
here is an example of how you can sort the contents of your list using an
anonymous delegate, which makes it very simple to sort the items in the list:
class Person
{
private string name;
public Person(string name)
{
this.name = name;
}
public string Name
{
get
{
return this.name;
}
}
}
static void Main(string[] args)
{
List<Personpeop le = new List<Person>();
Person mark = new Person("mark");
Person bob = new Person("bob");
Person frank = new Person("frank") ;
people.Add(mark );
people.Add(bob) ;
people.Add(fran k);
people.Sort(del egate(Person p1, Person p2)
{
return p1.Name.Compare To(p2.Name);
}
);
for (int i = 0; i < people.Count; ++i)
{
Console.Out.Wri teLine(people[i].Name);
}
Console.ReadLin e();
}
HTH
Mark.
-- http://www.markdawson.org
"Deniel Rose'" wrote:
Thanks Dave for your answer,
I still wonder how i can sort the list based on the comparison of "a"
values
I mean
private bool comp(A aref, A bref)
{
return aref.a<bref.a;
}
if i put this function in a icomparable, implementation may become
complex,
built-in sort of List can't do this, can it ? How can I make a sort()
then ?
Dave Sexton wrote:
Hi Deniel,
List<Twill expand on its own when you add items to the list. You can set
the Capacity, which affects how automatic resizing occurs within the List.
"List<TCapa city Property" http://msdn2.microsoft.com/en-us/library/y52x03h2.aspx
--
Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message
news:11******** *************@m 73g2000cwd.goog legroups.com...
class A {
public int a;
}
private void func()
{
List<Aaref=new List<A>();
//dosometing
aref.resize(100 00); <------ This is what i want to do
}
>
But there is no resize() implemeted.
Thanks for any help
>
Dave Sexton wrote:
>Hi Deniel,
>>
>If it's some sort of list Control to which you are referring then:
>>
>- for WinForms set any of the Bounds, ClientSize, Size, Width or Height
>properties
>>
>- for WebControl set the Width or Height properties or add custom
>attributes
>and styles.
>>
>--
>Dave Sexton
>>
>"Deniel Rose'" <de************ *@yahoo.com.auw rote in message
>news:11******* *************** @f16g2000cwb.go oglegroups.com. ..
How can I resize a list ? thanks
>
>
Hi Deniel,
Try the following code:
List<intlist = new List<int>();
list.Add(10);
list.Add(3);
list.Add(16);
list.Sort(
delegate(int i1, int i2) // anonymous method
{
return i1.CompareTo(i2 );
});
--
Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
Thanks Dave for your answer,
I still wonder how i can sort the list based on the comparison of "a"
values
I mean
private bool comp(A aref, A bref)
{
return aref.a<bref.a;
}
if i put this function in a icomparable, implementation may become
complex,
built-in sort of List can't do this, can it ? How can I make a sort()
then ?
Dave Sexton wrote:
>Hi Deniel,
List<Twill expand on its own when you add items to the list. You can set the Capacity, which affects how automatic resizing occurs within the List.
"List<TCapacit y Property" http://msdn2.microsoft.com/en-us/library/y52x03h2.aspx
-- Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message news:11******* **************@ m73g2000cwd.goo glegroups.com.. .
class A {
public int a;
}
private void func()
{
List<Aaref=new List<A>();
//dosometing
aref.resize(100 00); <------ This is what i want to do
}
But there is no resize() implemeted.
Thanks for any help
Dave Sexton wrote: Hi Deniel,
If it's some sort of list Control to which you are referring then:
- for WinForms set any of the Bounds, ClientSize, Size, Width or Height properties
- for WebControl set the Width or Height properties or add custom attributes and styles.
-- Dave Sexton
"Deniel Rose'" <de************ *@yahoo.com.auw rote in message news:11******* *************** @f16g2000cwb.go oglegroups.com. ..
How can I resize a list ? thanks
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Peter Mrosek |
last post by:
Hello,
I have the following declaration in an header file (abbreviated
version):
typedef struct {
unsigned char rgbBlue;
unsigned char rgbGreen;
unsigned char rgbRed;
unsigned char rgbReserved;
|
by: Z D |
last post by:
Hello,
BACKGROUND:
==============
I've created a Windows User Control that contains an Image Control (among
other controls).
The user control handles the picture resize event. Whenever the parent that
holds my user control is resized, I resize my image so that it uses the
maximum available space. Note: It takes about 2 seconds to regenerate the
|
by: Rob Richardson |
last post by:
Greetings!
I have a form with a listview, a menu, and a few text boxes, labels and
command buttons. I want to resize the listview when the form is resized to
that the widths of the spaces between the borders of the listview and the
borders of the form remain constant. I am finding this to be unexpectedly
hard. For one thing, I initialized some values in the form's Load event,
and I'm doing the control resizing in the form's Resize...
|
by: David Lozzi |
last post by:
Howdy,
I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders!
Now I am making a public function that will take the path of the uploaded image, and resize it with the provided dimensions. My function is below. The current function is returning an error when run from the upload function: A generic error occurred in GDI+. Not sure what exactly that means. From what...
|
by: Maxwell2006 |
last post by:
Hi,
I declared an array like this:
string scriptArgs = new string;
Can I resize the array later in the code?
Thank you,
Max
| |
by: mrbrightsidestolemymoney |
last post by:
Hi,
I'm having a problem resizing a (very big) nested vector. It's not the
most streamlined piece of code ever but I need this array to avoid
having to recalculate the same quantity millions of times!
The (relevant) snippets of code are below : since it's relevant though
L=28,T=96 (so TasteProps weighs in at a hefty
8*96*28*28*28*96=1,618,477,056 doubles )
|
by: Jim Langston |
last post by:
I really am not sure if this question belongs in this newsgroup, but not
sure where else to ask it.
There is someone working on a game that I tested, and it was taking >30
seconds to load. He stated that everyone else was taking 2 or 3 seconds.
Then he found one other person taking >30 seconds, and it turns out the
common denominator was both of us have Intel chips (Celeron) where the other
people have AMD.
I had him send me his code...
|
by: Ajith Menon |
last post by:
I have created a windows application in which the form needs to be
resized on the MouseMove event. The windows resize function takes a lot
of CPU cycles. And as the resize function is called on the MouseMove,
the form is resized around a 30-100 times in one second. This leads to
a high CPU utilization and all other application comes to a stand
still.
The form does not have any controls i.e. buttons, text boxes etc. It is
completely...
|
by: |
last post by:
I'm creating a user control where the size always needs to be divisible by three.
In the resize event within the custom control I'm having no problem maintaining the height to be the same as the width, but as soon as I try to add some code to make sure that the width is always divisible by three, VS crashes.
How can I force the width 9and height) to always be a factor of three? Thanks.
J
|
by: infoseekar |
last post by:
Image Resize & Rotation
Hi
I have 2 scripts, one for Image rotation and other image resize and they both are working.
Image resize scripts load the picture and resize it and Image rotation rotate the image by 90 deg. They are two differennt files i.e. resize.php and rotate.php.
What I want to do is to combine both rotate.php & resize.php files, so when the script resized the image than it will call rotate script to rotate the...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |