|
for the first problem, you will need draw the backgroundimage by yourself, override the paint event and calculate the bounds, draw it
the second, you can write it into registry, when application is starting, check the registry to determine whether the backgroundimage is selected.
|
|
|
|
|
Hi
Thank you for your quick response.
But I m still confused. I want to select the image as a background from the path (openfiledialog), and the image should at the center of the screen.
You wrote "draw the backgroundimage by yourself,override the paint event and calculate the bounds"
can u please tell me the code for it.
Second problem of saving the image: Next time when I run the application I must see the previously set background image. (I don't want to save the path in the database) you suggested abt registry..plz send code also for it.
please help........
|
|
|
|
|
see your email
|
|
|
|
|
i want to make a chronometer connected to the parallel port of the computer and i want to get some help if you have done any projcet like this,i have seen something about this in a forum so i decided to do this for my lesson project.it must iclude these;TLP521-4(Optocoupler), 74LS139 (Decoder), 74LS247(Display driver), 4 anode Display.
i am trying but i dont have enough knowlegde about displays,if you have any please help.
|
|
|
|
|
I can't understand,
If I have two form
One is form1
one is form2
how to set the button in form1 to open form2
|
|
|
|
|
If I understand you correctly, you want a button control on form1 to open form2?
In the Click event of your button, write some code like:
<br />
private void btnOpenForm_Click(object sender, EventArgs e)<br />
{<br />
Form2 myForm = new Form2();<br />
<br />
form2.Show();<br />
<br />
form2.ShowDialog(this);<br />
}<br />
I hope this helps.
Jeff Bramwell
|
|
|
|
|
i want to make a chronometer connected to the parallel port of the computer and i want to get some help if you have done any projcet like this,i have seen something about this in a forum so i decided to do this for my lesson project.it must iclude these;TLP521-4(Optocoupler), 74LS139 (Decoder), 74LS247(Display driver), 4 anode Display.
i am trying but i dont have enough knowlegde about displays,if you have any please help.
|
|
|
|
|
We need to display the data received from a csv stream in HTML format.
For this,we are thinking of importing into a dataset and binding a datagrid to the dataset.
Can someone provide the C# source of exactly how to go about it.
We DO NOT WANT to save the stream into a file,and then read through odbc;we would rather import the stream into a dataset directly
thanks in advance
|
|
|
|
|
If you just want to display it in HTML and don't need the DataGrid , you can do it the old fashioned way and parse the file using these rules.
- Write
<table> to your output stream - While your input stream has characters left:
- Read a line (or to the end) from your input stream.
- Write "" to your output stream.
- Replace all commas not inside a balanced set of quotation marks with
</td><td> .
- Replace all
</td><td>" with </td><td> . - Replace all
"</td><td> with </td><td> . - Replace all
"" with " . - If the first character of the line is
" , remove it. - If the last character of the line is
" , remove it. - Write the modified string to the output stream.
- Write "" to your output stream.
- Write
</table> to your output stream.
Now, you have a table with your CSV in it.
For example, following that replacement rule set with the string 1,2,3,4,"I say""Hello,"" and you don't","Com,ma" , we get the following replacements:
1,2,3,4,"I say""Hello,"" and you don't","Com,ma"
1</td><td>2</td><td>3</td><td>4</td><td>"I say""Hello,"" and you don't"</td><td>"Com,ma"
1</td><td>2</td><td>3</td><td>4</td><td>I say""Hello,"" and you don't"</td><td>Com,ma"
// Replace all "</td><td> with </td><td>.
1</td><td>2</td><td>3</td><td>4</td><td>I say""Hello,"" and you don't</td><td>Com,ma"
// Replace all "" with ".
1</td><td>2</td><td>3</td><td>4</td><td>I say"Hello," and you don't</td><td>Com,ma"
// If the first character of the line is ", remove it.
1</td><td>2</td><td>3</td><td>4</td><td>I say"Hello," and you don't</td><td>Com,ma"
// If the last character of the line is ", remove it.
1</td><td>2</td><td>3</td><td>4</td><td>I say"Hello," and you don't</td><td>Com,ma
"we must lose precision to make significant
statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi Friends
I made a project wich it has a form and I splited the form with 2 panel in the left hand I put a treeview control
Now I want to do these works:
When I click on one of the treeview nodes a related from or frame to that node display on right hand and these forms and frames are different from each other but the problem: there is only 1 method when you click on the treeview: private void treeView1_AfterSelect ( object sender, TreeViewEventArgs e )
I need to decicde on something that indicates which one of tree view nodes is selected.
If any of friends know how can I solve this problem please inform me.
thanks
FS.Hashemi
|
|
|
|
|
F. Hashemi,
Use the e.Node value that is provided by the event parameters. It will give you a reference to the clicked node.
Jeff Bramwell
|
|
|
|
|
I like to do a two-step process here.
1) When you create the TreeNode , set the Tag property with an identifier value that allows you to quickly ascertain the type of the TreeNode clicked. This could be as easy as using an Enum in your code.
2) As the previous poster suggested, use the TreeViewEventArgs.Node property to investigate the recently clicked TreeNode
You can refer to my article Building the CVS Root File Changing Utility here on codeproject.com for examples of using these properties together.
"we must lose precision to make significant
statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hey all,
I have DataRelation object between 2 tables & 2 DataGrids.
for some reasons, I delete the relation, activate an operation on the tables & then create the relation back. here is some code:
//before the operation starts:
Ds.Relations.Clear();
Ds.Tables["Cust2"].Constraints.Clear();
//after the operation
DataColumn dc1 = Ds.Tables["Cust1"].Columns["Id"];
DataColumn dc2 = Ds.Tables["Cust2"].Columns["Id"];
DataRelation Dr = New DataRelation("cust1to2", dc1, dc2);
Ds.Relations.Add(Dr);
everything is ok until now.
but when I tried to connect the tables to the datagrids:
DtGrd1.SetDataBinding(Ds, "Cust1");
DtGrd2.SetDataBinding(Ds, "Cust1.cust1to2");
I get the exception:
"Cannot have a relationship between tables in different DataSets"
does anyone know what is going on??
thanks
RoyRose
|
|
|
|
|
How can I maintain a strongly typed collection over a web service... when I try to access an item it turns out to be a generic object, and the type is generalized as an System.Object without its attributes/methods (even the ones specified as webmethod)
Its not allowing me to access any of the methods.
-Steven Hicks
CPACodeProjectAddict
-- modified at 2:16 Sunday 20th November, 2005
|
|
|
|
|
I am trying to recieve a couple of words out of an HTML web page. I have received the information and stored them in a string. How do I find and get everything after these words "Name:"?
Thanks for the help.
|
|
|
|
|
Name: (.*)
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have some CheckBoxes that I create at runtime and I need to iterate throught them. They are all named "TextBoxAuthorName1" "TextBoxAuthorName2" etc...
How can itterate through them in a for loop?
I think this might be called reflection, but i'm not sure..
i want to get their names, but i'm confused about how to do it...
|
|
|
|
|
Or is there a way to get all the controls on the webform and them filter out the TextBoxes and then filter them about again by their name?
/\ |_ E X E GG
|
|
|
|
|
An easy way to itinerate trough your TextBoxes without reflection is to get each contol you have in the collection that has the TextBoxes an check if it's name is the one you desire :
public void CheckContols() {
foreach(Control c in this.Controls) {
if(c.Name.StartsWith("TextBoxAuthorName")) {
}
}
}
Using reflection to do what you want is kind of like scratching your left ear with your right hand.
I hope you understand...because is a rough world out there...
|
|
|
|
|
Using reflection to do what you want is kind of like scratching your left ear with your right hand.
But why enumerate all controls? This would shorten the whole process a bit:
foreach(TextBox b in Contols) ...
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Try for yourself the method you described and you will notice an error message that sounds something like "Specified cast is not valid.".
A foreach can be used to itinerate through an Collection's items.
A collection can have items of differnt types (eg. you Controls collection : can have a Label , two Buttons an a bunch of TextBoxes ). When the foreach reaches a Button an tries to cast it to a TextBox it will cause an exception.
I hope you understand...because is a rough world out there...
|
|
|
|
|
This should work on a web app right?
/\ |_ E X E GG
|
|
|
|
|
when i do this on an aspx page all it returns is Form1? do know how i can get the controls?
/\ |_ E X E GG
|
|
|
|
|
Proably you walk through the controls of the aspx page. The ideea was to walk through the parent control of your TextBoxes. I assume that the parent control is Form1, than, in that case, my exemple above is almost the same, instead of this.Controls use Form1.Controls .
I hope you understand...because is a rough world out there...
|
|
|
|
|
hi
I have a Form form1 that has a non-static public method called func1()
form1 has a custom control object called CU1
how can i call form1.func1() from CU1??
|
|
|
|