|
mav.northwind wrote:
I assume the subkey you're trying to open doesn't exist (it should start with "Software", not ".Software").
Thank you, thank you!!!
The 'dot' did it! Pfff, if I knew that it was that simple...
I presume that once you get a little more experienced, you don't make any more mistakes like that. (I hope...)
Thanks again...
Markali
|
|
|
|
|
Though I am not much more experienced than you ,I may say, once you started to face with errors , you learn how to deal with them , esp. using debugger (watch is a great tool btw..), understand and comment on errors, than find the appropriate solution..
|
|
|
|
|
I am writing an application that allows user login by windows authentication (includes domain and username).
For example:
Username: MYDOMAIN\MyUser
Domain:MYDOMAIN
If this username is valid, application will check for user's role, if user's role is BUILTIN\Users then this user can do their works.
|
|
|
|
|
It's nice that you are writing an application, but what's your question?
mav
|
|
|
|
|
And?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
oops... I am trying to write this application, but I don't know how to write. Sorry,
|
|
|
|
|
Right, thats nice, so what's your specific question?
|
|
|
|
|
the code is from my work:
class Test
{
static void Main()
{
int a = 0x79de61c0; //2044617152;
a += 0x12345678;
//a 应为 0x8c12b838; //-1944930248
if( a< 0 ) a = -a;
//string str1 = a.ToString();
System.Console.WriteLine( a );
//string str2 = a.ToString();
}
}
Here: if( a<0 ) a=-a; means a will be positive(>0)
if we use line "str1" or "str2", we get a negative number:
-1944930248。
Why a.ToString() effects the result?
|
|
|
|
|
I'm not getting a positive number at all, a.ToString() doesn't effect the result.
I think you should be using long instead of int , otherwise you'll be getting overflows all the time and unexpected results if you rely on the sign of your values.
You can use the checked keyword or the /checked compiler flag to detect such overflows.
mav
|
|
|
|
|
dstang2000 wrote:
if( a< 0 ) a = -a;
And if you want the absolute value, try Math.Abs .
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
When I debug, I found it is a terrible bug in JIT.
btw: JIT instruction is correct.
I've asked somebody to report the bug to MS.
|
|
|
|
|
Hi Guys,
I missed a lecture yesterday and my lecturer was starting a new topic on logically linked arrays.Can you please explain this topic briefly to me with an example using a logically linked array.This will assist me the next time i go to class coz i wont be behind.
uni1985
|
|
|
|
|
That's a flame bait if ever I saw one
Why don't you ask one of your mates who attended the lecture to explain it to you?
You weren't there and neither were we, so how come you think we can tell you what your professor taught?
Let's reverse the situation: You find out what your professor wants you to know about logically linked arrays and then write an article here so that everybody can learn a valuable lesson.
mav
|
|
|
|
|
lindiwe wrote:
This will assist me the next time i go to class coz i wont be behind.
Yes, you will be!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a label that when it is clicked, a text appear. How do I make it toggle?
Click once appear, click again disappear?
thanX for any suggestions
|
|
|
|
|
You can use a boolean.
boolean isShow;
if(isShow)
{
showText
isShow=false
}
else
{
don`t show text
isShow=true
}
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
|
I created a windows with 5 tabs. On the design mode the taps appeared correct, when I look in the tab page (collection) property, they look OK but when I compiled the application, they are out of order.
Any ideas?
|
|
|
|
|
I ran into this problem b4, it seems to be a little bug in VS.NET You need to manually change the order that the Tab Pages are added to the TabControl in the InitializeComponent() method of your code.
Find where your TabControl is initialized and change the order in which the Tab Pages are added to the Controls collection. This will fix your problem.
|
|
|
|
|
OK. I was able to set the Form1.isMDIContainer property to true on the main form to prevent an exception from being thrown when showing a child form. Than I created a MDIChild form triggered by a menu item as the article from Microsoft says at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconMDIApplications.asp but I encountered a problem.
First, when the Form.isMDIContainer property of the main form is set to true, it causes the background property of the form to only show a system color rather than the color that I would like the main form to display. This is explicitly stated in the article link above from Microsoft. Therefore, I thought that I could put a panel on the main form to display the color that I selected for the main form, but now when the MDIChild form is displayed it is displayed BEHIND the panel that was added to the main form.
How do I get the MDIChild form to display IN FRONT OF the panel rather than behind the panel. I tried to set the code in a menu item like so but it did not work.
<br />
formChild frm = new frmChild();<br />
frm.MDIParent = this;<br />
frm.Show();<br />
The MDIChild form shows behind the panel. I had tried to change the code to frm.MDIParent = panelMain but it would not assign a panel to a form. I find it very hard to believe that I am forced to choose either between a gray background (system color) OR the possibility of MDI form functionality.
I would appreciate some additional input from an MDI expert who has done some sort of a work-around solution. The color that I want to use for the background color of the main form is simply not in the list of system colors. Need your assistance to either bring the MDIChild form in front of the panel or to change the color permitted for the parent form from a system color. Tried to set the MDIChild form TopMost property to true but that did not work either. Any suggestions?
|
|
|
|
|
|
Dave:
Thanks for providing me with that information. I attempted to convert the VB.NET code into C# code. Please look closely at it and tell me if you think I got something wrong. In addition, I still have one question.
<br />
MdiClient ctrlMDI;<br />
<br />
foreach (Control ctrl in this.Controls)<br />
{<br />
try<br />
{<br />
ctrlMDI = CType(ctl, MdiClient)
ctrlMDI.BackColor = this.BackColor<br />
}<br />
catch<br />
{<br />
<br />
}<br />
}<br />
The problem that the first line has is that there is not any CType conversion extraneous module inside C# of which I am aware. I attempted to use code like thus:
<br />
Convert.ChangeType(ctrl, ctrlMDI);<br />
but that doesn't work either. Besides, most of the Convert class methods are dedicated to methods like Convert.ToInt32() and Convert.ToString(). Could you kindly enlighten me about what the C# equivalent is to CType() with which many people are familiar in ASP.NET and VB.NET? Would appreciate it.
|
|
|
|
|
You might want to try
ctrlMDI = (MdiClient)ctl;
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Trying to get a button within a datalist to fire an event. However on the coding I'm not sure how to link to the button within the datalist.
My data list is called dlorders and the button is called btnEdit and carries a commandname edit. which then should fire code to open up 2 other buttons, cancel and update.
The label1.text is just test to see if code is firing which it aint!
public void dlOrders_Edit(object source,System.Web.UI.WebControls.DataListCommandEventArgs e)
{
//Turn on editing controls
dlOrders.EditItemIndex = e.Item.ItemIndex;
//Re-bind the data
sqlDataAdapter1.Fill(dsOrders1,"Orders");
DataBind();
Label1.Text = "Done";
}
have a created it right?
|
|
|
|
|
At the very least you would need a Label1.InValidate() or Label1.Refresh() after setting the text. Even then, you may have paint issues under some circumstances. It might be better just to set a form scope private boolean, and use it in the idle loop to do the refresh of the control states.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|