|
So, when I move the control in design-mode I would like the position settings not to be updated.
|
|
|
|
|
You're serializing a control? I didnt even think that you could serialize a control.
|
|
|
|
|
Actually, I would like to check in the constructor of my control where I am - in designer or in runtime. How can i do that?
|
|
|
|
|
Do you mean that you want to check to see if youre running in debug or release mode?
|
|
|
|
|
No. The control can be placed to the form in design mode in MSVS.NET IDE - design-mode or the application can be run - run-mode.
|
|
|
|
|
Try this:
if (DesignMode)
{
}
|
|
|
|
|
Ummm....What???
If you move the control, you're changing the position! When you move the control in the designer, the only property of the control being changed is Location. So how do you want to both move and not move the control? What are you really trying to do with this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Actually, I would like to check in the constructor of my control where I am - in design-mode in MSVS.NET IDE or in runtime, which means my application is started. How can I check that?
|
|
|
|
|
Just check the DesignMode property. It'll be true if you're in DesignMode and false if in Runtime or other.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I have a simple questions: How can I check inside the control where I am - in design mode or run-time mode?
Thank you in advance.
Goran
|
|
|
|
|
Well if you want to know what the parent of the control is just use the Parent property of the control. If you want to know where the mouse is, use the MousePosition property of the control.
|
|
|
|
|
Actually, I would like to check in the constructor of my control where I am - in designer or in runtime. How can i do that?
|
|
|
|
|
Say what? None of your code is executed during design time.
|
|
|
|
|
|
Actually, that's not true. When you drop an instance of your control on a form, the code IS executed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If your talking about your controls position on the form, AFAIK, you can't do that in the constructor. I don't think your control has it's Location property set until after the constructor returns.
I could be wrong though...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Every conrol has a property called DesignMode
you can check
if (DesignMode)
{
}
else
{
}
-
Drew
|
|
|
|
|
im a total newbie to c#, visual studio .net 2003 and even Access database 2000.. im doing my forms using visual studio and my data are all stored in access db..
i've some vague concepts abt how to design my app.. im not sure it'll work as i do not have enough knowledge yet, and i doubt i'll have enough time to research and come out with a solution on my own..
and so im here now, need some guidance, hopefully it's explained very simply to me as i really have some difficulty understanding those acronyms/terms for an app...
im doing this> a user keys in an ID no. in a textbox and then hits the enter key/Go button in a main form in visual studio, and the app will retrieve selected data (that ID no. user's data) out of Access tables and display that data in another form within Visual studio..
i hope to use wizards as far as possible due to simplicity and time constrain.. i understand that i cant get the wizards to meet all my criterias/expectations/aims so if need be, im ok to not use a wizard and build from scratch.. but that's where i get seriously stuck, i donno how to use visual studio TOGETHER with Access db.. i already read tutorials and help books but they are meant to teach a user to create forms and queries all WITHIN Access itself.. i wont be doing any forms within Access; im only doing forms in Visual studio and keeping data in Access.. i read microsoft access help but it's not basic enough for me to understand.. i need a simpler or more idiot teaching method but i cant find it online.. any recommendations? to be emphasized again> im really short of time.. so i cant read up too long either.. i cant understand as quickly without truly doing and exploring the work process... so in a dilemma now, whether to read and learn or doing by trial and error..
some things i have to do:
1) how can i retrieve selected data (that is, retrieving just the data of user with that particular ID no.) from access db to display in my form?
2) i've a form for employer to fill in.. this is to create files for customers who do not have a file stored in the db yet.. how can i save/store all the data that has been filled in into access db and at the same time ensure that the data is stored under a particular ID no.? (among the info filled in, one of the fields entered is ID no. so i want to keep all these data under THIS ID no. that's entered in the form)
3) does anyone know anything about nevron chart, .net charting or microsoft chart control 6.0? i would like to use the data (date and time of transaction) from db and display these data in a graphical manner, that is, to display data from db in a bar chart which is within visual studio.. which chart software can be supported/can be run along with access db and visual studio .net... which chart software is more appropriate for my needs?
please help me! i've tried on my own already but i cant do... i really appreciate your understanding!
thank you very much!
|
|
|
|
|
how can i check to see if a PC is connected to the internet? I would also like to find out the mode through which it is connected - Dial Up, Ethernet, WiFi, etc etc. I have scoured the internet for information but am unable to come up with anything
|
|
|
|
|
|
Hello,
I have in the declaration:
private Control[] allocGrading;
Then in one of my methods I have a call to another method in which I am passing the ControlArray:
this.SetupStageAllocation(this.allocGrading);
.....
private void SetupStageAllocation (Control[] controlArray)<br />
{<br />
<br />
controlArray = new Control[numStages];<br />
}<br />
However, my declaration of allocGrading still remains null, and I want to pass the value of Control array to SetupStageAllocation by reference, because all the Control[] will be setup in the same way. Any ideas what I am missing?
Thank you
|
|
|
|
|
you need to declare your method to take array by ref
private void SetupStageAllocation (ref Control[] controlArray)
{
controlArray = new Control[numStages];
// Do some stuff
}
this.SetupStageAllocation(ref this.allocGrading);
|
|
|
|
|
Thanks a lot, but I already figure that one out.
|
|
|
|
|
If the method always creates a new array, it's better to make the method return the array instead:
this.allocGrading = this.SetupStageAllocation();
private Control[] SetupStageAllocation() {
Control[] controlArray;
controlArray = new Control[numStages];
return controlArray;
}
---
b { font-weight: normal; }
|
|
|
|
|
I agree with Guffa. If you start getting used to passing by reference all over the place, it will soon get out of hand.
Matt Gerrans
|
|
|
|