|
Remove the .Version from the second line, and check all the methods. They are all there.
|
|
|
|
|
Hi everyone,
I'm trying to build a new set of controls for an application I'm writing. I've created a control that behaves a bit like a combo box and I've added it to a control which, in turn, I have added to a form. I designed the dropdown bit as a form so that it can be displayed outside the area of the control that I added it to. I can't find the Coordinates of the control within the main form so that I can tell the dropdown bit where to display.
Does this make sense? Does anyone know how to read these coordinates out?
Thanks in advance,
Russell
|
|
|
|
|
Hello,
I think I made a control which sounds like you descriped.
I used the 'PointToScreen' Method of my control and added the Hight of my Control as a startpoint for the Window.
MyControl c;
c.PointToScreen(new System.Drawing.Point(0, 0));
Hope that helps.
All the best,
Martin
|
|
|
|
|
Thanks very much,
just the ticket, looking good now.
Russell
|
|
|
|
|
Hi all,
I'm wanting to stretch a label dynamically.
"Autosize" only works for one line.
In order to do this I've done a manual word wrap and counted the number of lines,
Then changed the height of the label to no of lines * height.
It works after a fashion - but is there a better way to do this ?
In particular - the width of the label is in points.
The length of the string is the number of characters.
Relating the two depends on the fontsize and other spacing.
Any thoughts would be much appreciated
Cheers
Mike
|
|
|
|
|
hope this'll help you to get a better
Graphics gs = label1.CreateGraphics();
label1.Size= gs.MeasureString("label Caption",label1.Font).ToSize();
sameer
|
|
|
|
|
|
Fair warning:
I am trying to learn the new .NET way of saving configuration information, and I have found that the Configuration class's Save() method does not always work, though it raises no exceptions.
When I run my app by double-clicking the .exe file, it can save its configuration. But when running under the VS2005 debugger, not only is the configuration stored in a different file (app.vshost.exe.config instead of app.exe.config), but also Config.Save() will usually fail without raising any exception. In order to be able to save the config, I have to delete app.vshost.exe.config so that my app will recreate it.
Not to be bitchy, but I do find the irony humorous.
1. We used to write text (ini) files.
2. MS told us to use the registry instead.
3. Then MS told us never to use the registry, but use text (xml) files instead.
4. They provided the .NET 1.x way of doing things, which now results in "you shouldn't be doing this" warning messages.
5. They provided the .NET 2.x way of doing things, which (oh by the way) does not work dependably, at least under the debugger.
Is there any consensus as to what is really, truly the RIGHT way to save configuration information?
--
Charles Jenkins
"The accumulation of all powers, legislative, executive, and judiciary, in the same hands...may justly be pronounced the very definition of tyranny." "If tyranny and oppression come to this land, it will be in the guise of fighting a foreign enemy."
-- James Madison, Fourth President of the United States
|
|
|
|
|
hi,
in flex grid. i set focus a cell. at this time i want to get currosor postion x,y
how can i do this
vipin paliwal
|
|
|
|
|
use Mouse Move event of data grid.
1.create two class level integer variable
private int _xGrid=0;<br />
private int _yGrid=0;
2.now in mouse move event set value of these variables
private void dataGrid_MouseMove(sende , even e)<br />
{<br />
_xGrid=e.X;<br />
_yGrid=e.Y;<br />
} 3.use these values whereever you want
|
|
|
|
|
I want to transforming some JPG-Files to one PDF-File
in my programme, How to do it?
Thank you very much!
|
|
|
|
|
Sourceforge has some free libraries, and some commerical ones exist ( and advertise on CP from time to time )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I've been using CutePDF lately, it installs as a printer and the basic version is freeware. I've been very impressed with it. I don't think it comes with an SDK though, but I haven't looked.
Russell
|
|
|
|
|
hi
i have a structure which has 3 string variable and an arraylist when i created it hasn't given any error but when i am trying to store values into the array list its giving the error like
Error cannot have instance field initializers in structs
my structure is like below
struct catalog_info
{
public string format;
public string Name;
public string connction_name;
ArrayList resourses=new ArrayList ();
}
catalog_info[] catalogs = new catalog_info[20];
|
|
|
|
|
kalaveer wrote: ArrayList resourses=new ArrayList ();
You cannot have instance field initialisers in structs. So, you can't set a default value. It's the new call that is the problem. Your arraylist is also private.
I believe you can have a constructor in a struct, set the value there.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
but that initialization in the structure giving the following error
Error Field catalog_info.Name must be fully assigned before control leaves the constructor
why this error coming
please help me to avoid this error and get it work.
thanks,
kalaveer.
|
|
|
|
|
kalaveer wrote: but that initialization in the structure giving the following error
Error Field catalog_info.Name must be fully assigned before control leaves the constructor
why this error coming
Because you have to set the value of all members in the constructor. If you have no specific value for them, set them to null.
Remember that there is always a parameterless constructor for the struct, that initializes everything to 0/null.
I would suggest that you use a class instead of a struct, otherwise you can get some surprises when you start passing it around in your code. If you for example pass the struct to a method, the method will get a completely separate instance of the struct, but it still shares the same ArrayList.
---
b { font-weight: normal; }
|
|
|
|
|
Your ArrayList is default, so will be visible only within namespace (if I remember it correctly).
You should initialize the struct the same way you do it with the class. This means, you should write:
catalog_info catalogs = new catalog_info()
You can provide constructors for your struct, but not default one.
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
if i use only simple structure variable its working fine but i require structure array of 20 elements that time i got problem
so can you please tell me how to write the statement to create a structure variable with 10 elements and to call its constructor that creates my arraylist variable.
i tried like the below possible ways but none of it worked.
catalog_info [] catalogs = new catalog_info[20](10);
catalog_info [] catalogs = new catalog_info[20]();
and my structure is
struct catalog_info
{
public string format;
public string Name;
public string connction_name;
public ArrayList resourses;
public catalog_info (int i)
{
resourses=new ArrayList (i);
format = "";
Name = "";
connction_name = "";
}
}
|
|
|
|
|
You need to define 'worked'. Your code calls the default constructor, so none of your values are initialised, but it works. You could add a static method which creates your array and initialises it's members. Overall, I'd tend towards making it a class and not a struct. Anything else seems likely to be a hack.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
What about oing it this way:
catalog_info catalogs = new catalog_info(10)
Remember, struct is similar to class, not to Array.
It is value type, not a reference type, but you initialize it the same way as you do with the class
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
ListBox DataSource DisplayMember Property
Problems in C#
I have a (single select) listbox with data and
when I click on the list I can't get the right
text selected.
My listbox is setup using the DataSource property.
I set my ValueMember and DisplayMember
listBox1.ValueMember = "TypeID";
listBox1.DisplayMember = "Name";
I am able to get the "TypeID" (ValueMember) when I click on
the items.
I do that like this...
int intTest;
intTest = System.Int32.Parse(listBox1.SelectedValue.ToString ());
But I can't get the text (DisplayMember).
I have used these two ways, but...
string strDispMem;
strDispMem = listBox1.Items[index].ToString();
// the above returns... "System.Data.DataRowView"
or
strDispMem = listBox1.Text;
// The above repeats first selection the user clicks on.
Any ideas???
vipin Paliwal
|
|
|
|
|
listBox1.SelectedText ( from memory ) - it's something like that.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i not understand what u say, sorry.
pls give me brif
vipin paliwal
|
|
|
|
|
try out
for(int i=0;i < listBox1.Items.Count ; i++ )
{
if(listBox1.GetSelected(i))
{
strDispMem = listBox1.GetItemText(listBox1.Items[i]);
}
}
-- modified at 7:38 Tuesday 31st October, 2006
rahul
|
|
|
|