|
Why us a Mutex?? Are you trying to synchronize an operation between processes??
What exactly are you trying to do with this set of mutexes??
Should you be using a ManualResetEvent instead??
|
|
|
|
|
hi
I have a question about forms in c#.
every time i run the program on a different laptops with different size of screen the items that have the forms have not be in the same location that i have put it the first time on my laptop.
how can i make the appearance of the items that have the different forms to be to the same location on every laptop or pc i run my program?
can i make it parametric?
thnx
|
|
|
|
|
|
im trying to remove a tab page from my tabcontrol
based on its tab index
but i have the tab index in an int
heres the code
if (e.Button == MouseButtons.Right)
{
for (int i = 0; i < tabControl1.TabCount; i++)
{
Rectangle r = tabControl1.GetTabRect(i);
if (r.Contains(e.Location))
{
if (i == 0)
{
}
else
{
string tabindexint = i.ToString();
tabControl1.TabPages.Remove(i);
it wont let me use an interger as a tab index how could i possibly do this
|
|
|
|
|
|
|
I REALY need to use the int tho because thats how i get
that selected tab name since its a right click selection
not a left click selection u can see it in the code
|
|
|
|
|
Try RemoveAt() - myTabControl.TabPages.RemoveAt(i);
|
|
|
|
|
thx and how do i get the page name of a tab based on is index
like what is the name of tab at index 4
|
|
|
|
|
Try something like
for (int i = tabControl1.TabPages.Count - 1; i >= 0; i--) {
if (tabControl1.TabPages[i].Text == "Header")
}
|
|
|
|
|
i got it to work using this
string tabpagenamex = tabControl1.TabPages[i].Name;
can u explain what the [] part means to tabpages
|
|
|
|
|
It means absolutely nothing to TabPage.
It means everything in C# because that's an array you're indexing into.
If you didn't know this, you REALLY need to pickup a beginners book on C# and work through it. Arrays are something you learn about in the 1st or 2nd week of an intro to programming class.
|
|
|
|
|
[] basically accesses an array item.
As mentioned, it might be useful for you to catch up on some basics.
|
|
|
|
|
definitly ive only been doing any sorts of coding for two months
im learning as i go still most of it is uncomprensible
but i think im doing prety considering my lack of prior
knowledge
|
|
|
|
|
Keep learning new things while practicing - that is the only way to make more topics comprehensible.
|
|
|
|
|
hi,
is there a way that i can get the attributes in my class dynamically like calling a function which return all the attributes in my class in an list/array?
however, without hard-coding so that even when my class attributes changes i dont need to change this function
|
|
|
|
|
Try:
Type type = typeof(MyClass);
object[] oat = type.GetCustomAttributes(true);
foreach (object at in oat)
{
Console.WriteLine("{0}", at.ToString());
}
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
The method 'PrintAuthorInfo in this on-line MSDN example of custom Attribute use [^] shows you how to get all the Attributes into an Array of System.Attribute, and access fields, and call a function that returns a string.
“Humans are amphibians: half spirit, half animal; as spirits they belong to the eternal world; as animals they inhabit time. While their spirit can be directed to an eternal object, their bodies, passions, and imagination are in continual change, for to be in time, means to change. Their nearest approach to constancy is undulation: repeated return to a level from which they repeatedly fall back, a series of troughs and peaks.” C.S. Lewis
|
|
|
|
|
Hi,
Please let me know how may I store follow string value into string variable ?
string myValue = "aa[a"a]aa";
Thank you in advance
|
|
|
|
|
use a backslash to escape the quote
string myValue = "aa[a\"a]aa";
|
|
|
|
|
string d = "this is a open quote \" and this is a \" close Quote";
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
To add to what Davey and Simon have said, '\' is an "escape" character, which tells the compiler that the following character is a special, rather than a standard character. A '\' followed by double quote is a double quote character rather than the end of the string, and other sequences have different meaning, such as \\ for a '\' character, \n for a newline and \t for a tab. You can also use:
string myValue = @"aa[a""a]aa"; The '@' turns off recognition of the '\' as a special, allowing you to type a single '\' character if you are entering a path:
string mypath = "D:\\Temp\\myfile.txt";
Or
string mypath = @"D:\Temp\myfile.txt"; When you use a '@' prefix, you use tqo double quote characters together to insert a single double quote character in the string.
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
hi
does anyone know how i can create a general log eg if i had classes
student: id,name,age
and
teacher: id, name, nation
as you can see the 2 class differs
is it possible to create a table which can save each changes i make like a log?
so that i can see the changes i made.
|
|
|
|
|
Where do you want to save the information and in what format? If you just want general logging of transactions then take a look at log4net Tutorial[^].
Use the best guess
|
|
|
|
|