|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
the thing is i have a really large picture (1600 X 1200) and i have to put it in a picture box on a form. The form is at maximum size (1200 X 1000) so only a part of the picture is dyplayed becouse the picture box is larger than the form. The question is can implement some kind of scrollin on the picture and how do i do that?
rzvme
|
|
|
|
|
This should be possible by putting the PictureBox (full size of picture) into a Panel (wanted size) which is a scrollable control.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
my project does not depend on virsual connection and virsual dataset
and when i design the report i design it on virsual dataset after i finsh the design i remove the dataset and i asign for the report datasourse {My dataset} but when i run the report does not have the data in my dataset
how can i solve it
thanks for help
fatma
|
|
|
|
|
You might find this[^] documentation on MSDN helpful.
|
|
|
|
|
Hi Friends,
I developed a desktop applcation in .NET 1.1 frameework using C#.
The application works perfect in Windows XP or Windows 2000 Server environment, but in Windows 2003 server the application is really slow. The performance is degraded upto 200%. i.e. it takes 4 times more time in Windows 2003 server than under Windows XP or Windows 2000 server.
Can anyone tell me what is the problem and can it be rectified.
Thanks,
Sushant Duggal.
|
|
|
|
|
That's a fairly broad question, have you tried profiling the application? If you don't have a commerical profiler, try the CLR Profiler[^] from Microsoft.
|
|
|
|
|
I was doing some final testing on a program that I build last week, when I encountered the following error in a databound datagridview
DataGridViewComboBoxCell value is invalid
It happend without a real reason, because nothing has changed since the last test and that last test succeeded without error.
Anybody have a clue as what might be going on here? I checked the databinding, but that seems correct to me. So it must be something else.
WM.
What about weapons of mass-construction?
|
|
|
|
|
I have a "Back" link in aspx page.
If clicked on this link it go to previouspage. For this I wrote back
It is working fine.
But I also Have a continue button which inserts data into db when clicked on it.
So If i go back and click on continue new record is inserte for the same member i don't want that to happen.
I want to maintain state persistence.
how can I do this.
Can Anybody help me
Thanx in Advance
chanti
|
|
|
|
|
This question belongs in the ASP.NET forum.
|
|
|
|
|
private void WhatFormToShow(Form f)
{
f.MdiParent = this;
f.Dock = DockStyle.Fill;
f.Show();
this.pnlCompositeCon.Controls.Clear();
this.pnlCompositeCon.Controls.Add(f);
this.txtCurrentLoadedForm.Text = f.Name.ToUpper();
}
WhatFormToShow(FrmAdd);
when i call the function i got this error, that said "its a 'type' but us used like a 'variable'...what is the proper way of doing this? please help
-- modified at 3:18 Saturday 14th October, 2006
|
|
|
|
|
What is the exact (!) error message you get?
The compiler won't tell you "its a 'type'". What is 'its'?
Could it be that FrmAdd is the name of your form class and not the name of a form instance?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
All I can do is guesses.
I guess that you get the error at this line:
WhatFormToShow(FrmAdd);
and I guess that FrmAdd is a class name. Is this the case? If so you have to pass an object no a class to the method.
Regards
|
|
|
|
|
thanks for reply
Yup i want to pass the form class name so i can instantiate the form by using the function.
Im tired of typing...
FrmNew myF = new FrmNew();
myF.Show();
or if there are more form setting to setup.
i want to pass the form name so the function can create it and instantiate it automatically.
Im new to c# any links to enlighten me more on this subject please dont hesitate to point me to the right direction
Thanks
|
|
|
|
|
While you can achieve something like this using reflection, I strongly doubt that you should do it.
Giving "I'm tired of typing..." as the reason simply isn't enough. What are the advantages you get for the flexibility you lose?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Well, you want to make some sort of a Froms factory!! This is possible, but as Mav said... Why?? Each form has its own special properties to be initialized. Why don't you initialize them at design time once??
Anyway, I'm not in the position to judge or modify your coding style. All I wanted was to guide you to what I think is better than what you want. Trust me, this isn't the reason to make such a factory method.
Anyway, you can do it -like Mav said again- using Reflection namespace.
1- Declare your method as
MyMethod(Type TheForm)
2- Call it as
MyMethod(typeof(FormClassName));
3- In the Form you can call Assembly.CreateInstance() to create your form. Then using this object you can initialize it.
Yet, again... Does it really worth all this??
Regards
|
|
|
|
|
I see. Thanks mav and nader
I really wanted to implement this as part of my UI. I have created an mdi application that mimic the MS MONEY 2006 tab bar
tab ---> HOME BILLING INVENTORY
So if i click on the HOME TAB, it will only load a single form. this is all done in my FrmMain. this is why i have this sub.
private void SelectTabToView(string sWhatTab)
{
switch (sWhatTab.ToUpper()) {
case "HOME":
FrmHome F1 = new FrmHome()
F1.MdiParent = this;
F1.Dock = DockStyle.Fill;
F1.Show();
this.pnlCompositeCon.Controls.Clear();
this.pnlCompositeCon.Controls.Add(F1);
this.txtCurrentLoadedForm.Text = F1.Name.ToUpper();
break;
case "BILLING":
FrmHome F2 = new FrmHome()
F2.MdiParent = this;
F2.Dock = DockStyle.Fill;
F2.Show();
this.pnlCompositeCon.Controls.Clear();
this.pnlCompositeCon.Controls.Add(F2);
this.txtCurrentLoadedForm.Text = F2.Name.ToUpper();
break;
case "INVENTORY":
FrmHome F3 = new FrmHome()
F3.MdiParent = this;
F3.Dock = DockStyle.Fill;
F3.Show();
this.pnlCompositeCon.Controls.Clear();
this.pnlCompositeCon.Controls.Add(F3);
this.txtCurrentLoadedForm.Text = F3.Name.ToUpper();
break;
}
}
So i could have used the function
private void SelectTabToView(string sWhatTab)
{
switch (sWhatTab.ToUpper()) {
case "HOME":
WhatFormToLoad(FrmHome);
break;
case "BILLING":
WhatFormToLoad(FrmBilling);
break;
case "INVENTORY":
WhatFormToLoad(FrmInventory);
break;
}
}
This is much easier than typing all those redundant settings
Thats why i have decide to create a generic routine or a form factory to catter the loading of forms by just passing the form name.
If im not on the right path in doing this please advice on what to do
Maybe i was just looking how to hammer a nail with a jackhammer
|
|
|
|
|
Well, you can use generics;P
Or much simpler, this:
private void SelectTabToView(string sWhatTab)
{
switch (sWhatTab.ToUpper()) {
case "HOME":
{
FrmHome frm = new FrmHome();
WhatFormToLoad(Frm);
break;
}
case "BILLING":
{
FrmBilling frm = new FrmBilling();
WhatFormToLoad(Frm);
break;
}
case "INVENTORY":
{
FrmInventory frm = new FrmInventory();
WhatFormToLoad(Frm);
break;
}
}
}
private void WhatFormToLoad(Form MyForm)
{
MyForm.MdiParent = this;
MyForm.Dock = DockStyle.Fill;
MyForm.Show();
this.pnlCompositeCon.Controls.Clear();
this.pnlCompositeCon.Controls.Add(MyForm);
this.txtCurrentLoadedForm.Text = MyForm.Name.ToUpper();
}
Regards
|
|
|
|
|
Thanks for the Prompt reply, nader
I was about to go on this direction. As i was playing with the Refactoring menu
anyway thanks for the input its highly appreciated
|
|
|
|
|
hey whats up? i need help! i query a database off a web site and i onnly want a few fields, this is in c#..
this db has thousands of records which is why i need to code this. this is just to make a contact list.
what i want is:
Pastor/Leader: John Cowan
Contact Info: phone: 916-387-9750
Mailing Address: 7322 Folsom Blvd, Sacramento, CA 95826 USA
Website: http://www.calvarysac.org/
html is:
body {margin ; font-family:"lucida grande", tahoma, arial, verdana, sans-serif; font-size:10px}
label {display: block; font: normal 10px/16px "lucida grande", tahoma, arial, verdana, sans-serif; margin: 0; padding: 0px 0; color: #666;}
.textfield {font: normal 11px/13px "lucida grande", tahoma, arial, verdana, sans-serif; padding:2px; margin: 0; border: 1px solid #ccc; background-color: #eee; width: 100%; color: #666;}
.textfield2 {font: normal 11px/13px "lucida grande", tahoma, arial, verdana, sans-serif; padding:2px; margin: 0; border: 1px solid #ccc; background-color: #eee; width: 207px; color: #666;}
#contact td {padding:5px;}
#contact table {width: 100%;}
h1 {margin ; padding ; font-size:20px; margin-bottom:7px}
div.hr {height: 2px; background: #ddd; margin:10px 0 7px 0 }
div.hr hr {display: none;}
a {color:#374872}
a:visited {color:#374872}
a:hover {background:#ddd}
#verified p span {padding:3px}
/* Images */
img {border: none;}
p.img {margin: 0; padding: 0;}
p.img img {float: right; margin: 0 0 1em 1em;}
p.img a img {padding: 3px; border: 1px solid #c4c4c2;}
p.img a:hover img {border: 1px solid #949492;}
Calvary Chapel Sacramento
Pastor/Leader: John Cowan
Contact Info:
phone: 916-387-9750
facsimile: 916-387-9752
Mailing Address:
7322 Folsom Blvd.
Sacramento, CA 95826 USA
Meeting Address:
7322 Folsom Blvd.
Sacramento, CA 95826 USA
★ View Map
Website: http://www.calvarysac.org/
//<![CDATA[
if(typeof sIFR == "function"){
sIFR.replaceElement(named({sSelector:"h1", sFlashSrc:"/assets/swf/avenir.swf", sColor:"#374872", sLinkColor:"#000000", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop , nPaddingBottom , sFlashVars:"textalign=left&offsetTop=0"}));
};
//]]>
|
|
|
|
|
Hello. Is it possible to create controls from a textfile?
For example, my text file contains:
Panel pNew = new Panel();
pNew.BackColor = System.Drawing.SystemColors.ControlLightLight;
pNew.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
pNew.Location = new System.Drawing.Point(3, 5);
pNew.Name = "panel1";
pNew.Size = new System.Drawing.Size(368, 408);
pNew.AutoScroll = true;
How do I go about it?
|
|
|
|
|
Hello
Well, to some extent Yes! It's possible, but depends on:
1- What are you storing in your text file? Are you storing other parameters like the location, size, etc...??
2- Do you know exactly what you are storing in the text file? ie. All the controls hve the same format, or do some controls have more properties stored than others?
3- Are all controls of the same type, or different types?? Do you know all the types you are declaring? Will there be UserControls, or controls unknown at design time involved?
Regards
|
|
|
|
|
The text file contains all the controls and it is of different types.. Some controls have more proerties stored and, yes I'm storing the location too..
Is there a command that executes this (the creation of controls?)?
Thank you!!
|
|
|
|
|
Well, one easy clumsy way -if you know all the types of controls you will declare- is to parse the text file and Create the controls in a switch. eg.
switch (MyInputType)
{
case "TextBox":
{
TextBox temp = new TextBox();
MyForm.Controls.Add(temp);
}
}
This way the temp variable will be destroyed, but the reference in the MyForms.Controls will keep the control alive. This way you can declare as many TextBoxes as you want.
If you expect UserControls or controls that you don't know its type, you'd have to use Reflection namespace which is by far bigger than to be covered in a single post.
PS.
Why use TextFile?? Why not XmlDocument?
Regards
|
|
|
|
|
I just started using C# in VS2003 (after learning vb.net)
When I type a variable name in VS2003 for a vb.net project - it corrects any capitalization for me.
Is there a way to do that for C# projects in VS2003 ?
Thanks.
|
|
|
|