|
I've got a VisibleChanged handler in a UserControl class that performs some functionality that includes using "this ". When I run the code as an app, it works fine, but when I try to load the UserControl into the designer, the IDE crashes. Is there a way to hide code from the designer, like a convenient compiler directive or anything?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I don't know whether there is a directive or not but you can check whether the control is at design time or not. See here: Detecting Design-time in C#[^]
|
|
|
|
|
Neither of the methods there worked for me, but it allowed me to use different search criteria in google, and found an answer right here on CP:
http://www.codeproject.com/KB/cs/DetectingTheIDE.aspx[^][^]
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am glad to here that you found an answer. Thanks for the article link
|
|
|
|
|
I see you solved this, let me just add that the designer has become a bad joke, it runs about half of your code, and if that code relies on other code that it doesn't bother to run, it crashes. MS says this is a feature.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
The designer is definitely a like bad dream once you start to do anything more complicated than simply accepting the default form in a new WinForms app, but You're forced to use it if you want a reasonable chance at designing a form in a short amount of time. Are there any alternatives that don't include the acronym "WPF"?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
my question is that how we can put a Hyperlink in the MessageBox in C#.
Thanks,
abhishek
|
|
|
|
|
You can't do it with standard messagebox, you need to develop your own and use linklabel control
|
|
|
|
|
Hi friends,
I have created voting application,i have almost finished it but i should check that one user should vote once by getting his session any idea for this....
Checking IP address will prevent other users voting so i need to take user browsers session or some other ideas for this method.....
|
|
|
|
|
First of all, we have an ASP.NET forum, why did you not ask there ?
Second, there's no way to do this. A new session is created when someone reconnects to your site, and so an IP address is your only option, and that won't work if someone has a dynamic IP and reconnects to the web. The only way for this level of control is to issue people with a login and let every login only work once.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
How can I sort the windows taskbar items in c#. I would like to write a small program that looks for programs on the taskbar, and rearrange them if a custom order should it find them.
|
|
|
|
|
|
Hi,
I'm currently in the planning stages of a medium sized application.
The essence of this application will be a website, similar to hotel booking sites like booking.com
I'm deciding what data access to use...
I've narrowed it down to two options - nHibernate, or Microsoft Data Access Application Block
In what situation would either of those be a better option?
|
|
|
|
|
Hi,
I need the following functionality in my application. I have a main form, from where I display second form to get input to the main form. I want to lock the main form until I get the input from the second form. Can somebody advise me how to acheive this from c#.net windows based application?
Thanks
Sunitha
|
|
|
|
|
try this if it help
yourformyouwanttoshow.ShowDialog();
ahmed eldeghedy
|
|
|
|
|
Hello,
Have you tried using the
ShowDialog() method when you are opening the second window from within the form1's code? E.g.:
private void button1_Clicked(object sender, EventArgs e)
{
Form SecondForm = new SecondForm();
SecondForm.ShowDialog();
}
This will open the second form on-top of the first form, and the main form cannot be accessed until the second form has been disposed.
Hope this helps.
j.t.
|
|
|
|
|
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (dataGridView1.CurrentCellAddress.X == 1)
{
TextBox txt = e.Control as TextBox;
txt.AutoCompleteCustomSource = ItemCode;
txt.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
txt.AutoCompleteSource = AutoCompleteSource.CustomSource;
e.CellStyle.ForeColor = Color.Red;
}
}
i use this cod to assign auto Complete to the text box in data grid
it work well but it work for all text boxes After my text i need to assign for it
ahmed eldeghedy
|
|
|
|
|
Have you tried using the debugger to see what is being passed as the X value ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi All,
I Want To Convert ToolStripMenuItem Object To Label....
Such As,
private void ChangeSetting(object sender,EventArgs e)
{
Label L=(Label)sender;
}
but I Cannot Do That. Please Help Me
Thank You All
|
|
|
|
|
You cannot cast ToolStripMenuItem to Label, if you want to get/set the text of the menu item use the Text property.
Regards,
Lev
|
|
|
|
|
i'm trying to do as the title says...
im using a DataTable and add DataRow[] in it and every DR contains a column type of a class i have made. The class have 2 properties, a string and an int. Then i bind that DataTable to DataGridView. Now problem is that its showing the class name with Namespace and it should. But i want it to show that string property in that column.
Its exactly same like ComboBox or ListBox binding.
I tried with DataPropertyName but all columns appear blank
dataGridView.Columns[0].DataPropertyName = "Name";
full code
DataTable tmp_dt = new DataTable();
tmp_dt.Columns.Add("Info", typeof(XYZclass));
DataRow tmp_dr = tmp_dt.NewRow();
tmp_dr["Info"] = new XYZclass("a string Param to set the string in class");
tmp_dt.Rows.Add(tmp_dr);
dataGridView.DataSource = tmp_dt;
dataGridView.Columns[0].DataPropertyName = "Name";
any idea ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
You need to override the ToString() or create an implicit operator string (can't remember which one). Then, your class will correctly display wich ever string you want to be displayed in the datagridview.
|
|
|
|
|
Tony_P wrote: You need to override the ToString()
hmmm...seems to be gonna work...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
removed
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
modified on Sunday, December 14, 2008 2:10 AM
|
|
|
|
|
Hi There,
i have problem using reportviewer,
when the values in the dataset are null it will show #Error label instead of blank field.
how can i replace or hide the null value into blank field ?
i tried =iff(fields!fieldName.value=Nothing,"",fieldName.value=Nothing) (on report)
(didn't work)
thanks
Roy
|
|
|
|