|
Pls i need help, 'm kinda new 2 this.
i make an mdi container, then a button is pressed, then i call out a form and make it a child like this:
frmOne frm = new frmOne();<br />
frm.MdiParent = this;<br />
frm.Show();
Already, in the properties of frmOne i set it's WindowState Property to Maximized but when it comes out it is normal.
pls how else can i achieve this.
thanx.
He who goes for revenge must first dig two graves.
|
|
|
|
|
Try
frm.Size = frm.MaximumSize
?
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Im trying to pass a Class I have created to a button and am having some trouble finding where to overload the call function.
Here is the buttons code.
private void btnCalcLife_Click(PumpTest pTest, EventArgs e)
{
intgrav(pTest);
lblLife.Enabled = true;
lblLife.Text = lblLife.Text + pTest.tlife + " Hours";
}
The error is taking place in my designer window
this.btnCalcLife.Click += new System.EventHandler(this.btnCalcLife_Click);
|
|
|
|
|
The event handler of your button click must take object as a first argument. That's why you are getting error.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
I changed it to several different overloads, but still getting an error. Here is what it is now
private void btnCalcLife_Click(object sender, PumpTest pTest, EventArgs e)<br />
{<br />
intgrav(pTest);<br />
lblLife.Enabled = true;<br />
lblLife.Text = lblLife.Text + pTest.tlife + " Hours";<br />
}
I think I need to change this statement but dont know what to change it too
this.btnCalcLife.Click += new System.EventHandler(this.btnCalcLife_Click);
|
|
|
|
|
Why don't you have a look at documentation of button click event? You can't add additional parameter to the event handler.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
As Giorgi said, you cannot change the parameters of the event handlers. For the Click event, you get the first object sender parameter, which is always a reference to the Button sending the event (you can cast it), and EventArgs e which is useless. Other events pass arguments (eg. location where mouse was clicked) in an EventArgs -derived second parameter.
If you create your own event, you should derive from EventArgs to create your own class for passing parameters to the event handler. But you can only do this for events you define, not for system-defined events.
|
|
|
|
|
Yea thanks for the help, I found an article online about setting up a ridiculous way to send something to a button through a wierd method but found it easier to just set up another Public instance of the class and set it equal to the class passed by the parent form.
|
|
|
|
|
Hi sir.. i am trying to create a peer-to-peer application for my practice in c#.. i was wondering if any one could tell about the concept of peer-to-peer.. only.. thank you so much in advance..
|
|
|
|
|
pdoy0708 wrote: i was wondering if any one could tell about the concept of peer-to-peer
No, nobody knows anything about it, and if they did they certainly would not create a Wikipedia page on that subject, and if they did you certainly would not be able to find it by searching with google.[^]
Good luck, you're going to need it.
led mike
|
|
|
|
|
|
The unfortunately reality is that a truly anonymous peer-peer application used to be possible through the use of Broadcast packets however the potential abuse is too high.
Read up on Tor and Onion routers for a good look at anon. Peer to Peer.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
How can i load data from a comboBox into a datagrid.Basically the comboBox has a list of venues.When you select a venue the datagrid is supposed to display timeslots that are booked and those that are not booked for that particular venue.the data for the grid is taken from three different tables.(TimeSlot[with all the different timeslots]),(Venue[with all the different venues ])and (Timetable[with all the venues that are booked and the timeslots that they are booked for]).
Any code that will hep me with this problem will be greatly appreciated.
|
|
|
|
|
Hy,I have a custom control that has a list of images. My problem is that i want to set the list at design-time. I have the images in my project resources, so why can I set an image at design-time,and not a list of images??
Please help,I am really stuck here.
|
|
|
|
|
ctoma2005 wrote: I have a custom control that has a list of images. My problem is that i want to set the list at design-time.
Does your custom control publish a public ImageList property?
led mike
|
|
|
|
|
Well i don't need an ImageList,that's a component. I just want a property that represents a list of images (List). The only thing I could think of is making the property of type Image[] and instantiate the array in the constructor, but I don't now the size of the array,that is why I need a List.
|
|
|
|
|
Sorry for the misunderstanding, I wrote ImageList,thinking of an list of images. Thanks
|
|
|
|
|
List doesn't have a control designer. Therefore, the designer doesn't know how to represent it in the designer. Roll your own collection class and define a control designer.
|
|
|
|
|
Ok,but my problem is that the control is in a class library,so how can that assembly know what resources my application has? I don't understand how can there is no way of choosing a list of images. There is a UITypeEditor for every collection,but it doesn't work for images,as images don't have a constructor. I am really confused now, I mean a list of images can be used by hundreds of controls...
|
|
|
|
|
Maybe if you can tell me how an Image Editor works,because all I really need is an Image Editor,wich lets me select multiple images (just like a listbox)
|
|
|
|
|
Hi
I try to develop an Web Application to manage films (a little bit like ImDB)
For the Edit part, I fill textboxes with a Linq query (on loading).
No problem to display the information in the different textboxes
But when I want to save changes into the database,
my textboxes are empty (according to the debugger) even if I put a value in it.
A part of my code to do this edition :
Loading :
<br />
DBMovies_ClassesDataContext db = new DBMovies_ClassesDataContext();<br />
<br />
int IdFilm = int.Parse(Session["idfilm"].ToString());<br />
<br />
var editedfilm =<br />
(from f in db.Films<br />
where f.id == IdFilm<br />
select new { Title = f.title, Title_o = f.title_original, Language = f.language, DateRelease = f.date_release, Genre = f.genre, Runtime = f.runtime, Plot = f.plot, Country = f.country }).Single();<br />
<br />
<br />
txtCountry.Text = editedfilm.Country.ToString();<br />
txtDateRelease.Text = editedfilm.DateRelease.ToString();<br />
txtGenre.Text = editedfilm.Genre.ToString();<br />
txtLanguage.Text = editedfilm.Language.ToString();<br />
txtPlot.Text = editedfilm.Plot.ToString();<br />
txtRuntime.Text = editedfilm.Runtime.ToString();<br />
txtTitle.Text = editedfilm.Title.ToString();<br />
txtTitle_o.Text = editedfilm.Title_o.ToString();<br />
<br />
Code to update values in DB :
<br />
<br />
DBMovies_ClassesDataContext db = new DBMovies_ClassesDataContext();<br />
<br />
<br />
int IdFilm = int.Parse(Session["idfilm"].ToString());<br />
<br />
var updateFilm = (from f in db.Films<br />
where f.id == IdFilm<br />
select f).Single();<br />
<br />
<br />
updateFilm.country = form1.FindControl(txtCountry.ID).ToString();<br />
<br />
updateFilm.country = txtCountry.Text.ToString();<br />
updateFilm.title = txtTitle.Text.ToString();<br />
updateFilm.title_original = txtTitle_o.Text.ToString();<br />
updateFilm.language = txtLanguage.Text.ToString();<br />
if (txtDateRelease.Text != "") { updateFilm.date_release = DateTime.Parse(txtDateRelease.Text); }<br />
updateFilm.genre = txtGenre.Text.ToString();<br />
if (txtRuntime.Text != "") { updateFilm.runtime = Int32.Parse(txtRuntime.Text); }<br />
updateFilm.plot = txtPlot.Text.ToString();<br />
<br />
db.SubmitChanges();<br />
<br />
and an exemple of my textboxes :
<asp:label id="lblCountry" runat="server" text="Country : "></asp:label><br />
<asp:textbox id="txtCountry" runat="server"></asp:textbox>
All the elements are working well
It's just the empty textboxes which ruin everything
Thank you by advance
(and sorry if there are english mistakes)
Cedric.
|
|
|
|
|
hi
i want to create custom pictureBox with panning and zooming functinallity, for start, i found this article :
http://www.codeproject.com/KB/GDI-plus/PanZoomExample.aspx[^]
but it's in Vb and when i convert it to c#, it take me some error(s) and i don't know what that error (because i don't know vb), can anyBody help me for this aim ? (article and sample code in c#)
thanks.
|
|
|
|
|
The article provides a dll which you can add to your program as a reference and use classes inside it. No need to convert it in C#.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Hi, I am using a VC++ dll in which "GetNamedSecurityInfo" and "GetExplicitEntriesFromAcl" API are being used for accessing Shared folder rights and number of users.
This Dll is returning correct number of users when I am using it in a Windows Application.
But, it is returning number of users as 0(for the same folder), If I am using it from a Web Application.
Plz help !!!
DDeepali
|
|
|
|
|
Hi All,
I am working on a project in which a person has to enter multiple data at the same time...
as there is a window have 3 text boxes like
Article Name
Article type
Price
... so a person can purchase mutiple article ...
i kept 3 buttons on this form as"ok"," submit ",cancel.
when you say ok it will save the data of respective field some here and wait for the next ok if again ok save both data some where and wait till untill submit or canncel...
if submit is pressed so the data have to be displayed as a report....
so where i can save this data .... i ll delete this file after every click of cancel or submit.
please help me here...
Thanks in advance..
T@SU
|
|
|
|