|
This is extremely complicated. In order to get the name of a control, you have to use a property. To get access to a property you first have to access the control, which is done by writing the name of the control into the code. Then you put a period after the name. Not before or in the middle of the name, but after the name. This is very important. Then you have to specify what property it is that you want to access, and that is done by writing the name of the property after the period. To get the right property, you have to know the name of that exact property. In this case you want the property that returns the name of the control, which for some strange reason has been called Name. So by typing those four letters after the period, you gain access to the value that the property returns.
Now, have a go at putting this complicated code together, and come back with any questions you might have.
---
single minded; short sighted; long gone;
|
|
|
|
|
I use the Visual Studio 2005. Now I want to use different Resource.resx and Settings.settings. With the configmanager I want to select the Resource.resx and Settings.settings.
|
|
|
|
|
For to get a different resx u can load from a file
System.Resources.ResXResourceSet resxSet = new System.Resources.ResXResourceSet("C:\\...");
for to load Setting I can't remeber now
|
|
|
|
|
This code runs fine.
When it's run, output says Struct A's size is 16 and Struct B's size is 12, even though
both contain 2 ints and 2 chars each.
Can someone tell me how the heck that is possible?
#include "stdafx.h"
#include <iostream>
using namespace std;
struct
{
char c1;
int i1;
char c2;
int i2;
}a;
struct
{
int i1;
int i2;
char c1;
char c2;
}b;
int main()
{
cout<<"sizeof struct A " <<sizeof(a);
cout<<"sizeof struct B " <<sizeof(b);
getchar();
return(0);
}
ASP - AJAX is SEXY. PERIOD.
|
|
|
|
|
yeah...err...this is the C# forum...
|
|
|
|
|
Although you posted in the wrong forum, I will try to answer your question.
A char is aligned on a two byte boundary and an int is aligned on a four byte boundary. The structs will be padded with unused bytes to align the values.
This represents the memory layout of the structs, where _ represents an unused byte:
a: c___iiiic___iiii<br />
b: iiiiiiiic_c_
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I agree in general, but your "A char is aligned on a two byte boundary" surprised me;
I expect it to be true in C# (because char=2B), and false in all C compilers I know.
Normally variables get aligned on a multiple of their natural size, hence 1 for char
in C/C++. Is it different in C++ ? or is Microsoft doing special things, if so
what would be the main reason for this ?
Best regards.
|
|
|
|
|
You are right, a char is not aligned on a two byte boundary. The b structure will of course be aligned as this:
b: iiiiiiiicc__
The structure is aligned on a word (32 bit) boundary.
The alignmment is all up to the compiler. If it was more efficient to access a byte at an even word address, it would probably have aligned it like this:
b: iiiiiiiic___c___
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi all. I am using daReport to create a report and i need an image on the report. I thought it would be as easy as sending the image name: "Test.jpg" as a parameter to the xml file and daReport would use that as the the image name. but no such luck as yet.
The parameter name is logopath:
<parameter name="logopath" />
i tried to use it like this...
<pictureBox x="457" y="26" width="314" height="130" strech="true"><br />
<file>$P{logopath}</file><br />
<border width="1" color="Transparent"></border><br />
</pictureBox>
This then shows a blank spot where the image should be.
i used the same for a text field...
<textField x="601" y="206" width="100" height="23"><br />
<text horAlignment="Left" verAlignment="Top">$P{logopath}</text><br />
<font family="Tahoma" size="10" ></font><br />
<foregroundColor color="Black"></foregroundColor><br />
<backgroundColor color="Transparent"></backgroundColor><br />
<border width="1" color="Black"></border><br />
</textField>
This worked fine as it showed the text: "Test.jpg". How would i use this text as the image name?
Thank you in advance.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Won't the author of daReport be the best bet for an answer to this question?
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
okay... i just thought that someone might have used it and would know the answer. but i will ask the author.
Thank you anyway.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi all,
I seem to be having a problem with the configuration of my setup project.
Everything installs fine, however when the user launches the application for the second time after installation (via an icon on their desktop or start menu), the application first rechecks the MSI from which the application was installed.
I simply cannot find what has caused this to occur, and this will likely become a significant issue for the end users if they delete the original MSI package (this results in a failed attempt to find the package and subsequent failure to launch the application).
Any ideas as to what I've done wrong?
By the way, the source application is compiled from a mixture of C# and VB.NET projects - not sure if this is of any help.
|
|
|
|
|
i want to replace an item of array with another item
for example replca the value of arr[5] with arr[7]
ma_refay
|
|
|
|
|
object temp = arr[7];
arr[7] = arr[5];
arr[5] = temp;
|
|
|
|
|
This is done with a regular assignment:
arr[5] = arr[7];
---
single minded; short sighted; long gone;
|
|
|
|
|
i want to check the type of all controls and execute somecode on controls on type for example heck all my form controls type and the control with the type button change it's color
ma_refay
|
|
|
|
|
foreach(Control c in Controls)
{
Button b = c as Button;
if ( b != null)
{ // It's a button
b.BackColor = Color.Red; // or whatever
}
}
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i have form that contain some buttons i wnat to when click one button and then click other button the form swap button lcation together
i need the best code
ma_refay
|
|
|
|
|
Swap the Button's Location property.
|
|
|
|
|
i don't now how to tell application to sap button
for example i have 30 buttons on my form
how i told him to swap buton1 with button20
or button15 with button7
ma_refay
|
|
|
|
|
You don't swap the buttons, you simply switch places on the buttons.
Get the value of the Location property from one of the controls and store in a temporary variable. Then get the value of the Location property from the other control and put in the Location property of the first control. Lastly, you get the value from the temporary variable and put in the Location property of the second control.
---
single minded; short sighted; long gone;
|
|
|
|
|
anybody plz tell me how how to use use mouse button-up & mouse button-down for drawing in paint program as we do in microsoft paint in windows....
|
|
|
|
|
The mouse move is the event that matters. You need to keep track of the co-ordinates it moves to, and use them to draw a line in your onPaint handler. You call Invalidate() to force a Paint event.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am creating an application in C#
where in I require to add a toolbar.
that is no problem and that is done as well.
What I need now is that the toolbar that i insert should be a floating
toolbar
e.g. any toolbar in Office application is a floating toolbar . One
can drag them anywhere and also fix it on the top.
How do I get my toolbar to be a floating one
help me pls
Thanks
Prasad
|
|
|
|
|
How about searching in CodeProject.....
http://www.codeproject.com/cs/menu/ToolBarDock.asp
|
|
|
|