|
|
I have a form that can optionally display several MDI children forms. I have a toolbar that when clicked, I'd like to make the child visible and bring it to the front. If the child is already visible but not in the front, I'd like to bring it to the front. Finally, if the child is visible and in the front I would like to hide the child until the button is pressed again.
I have no problem showing/hiding or bringing the form to the front, but I don't know how to determine which form is on top. Any ideas on how to do this?
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
how to add date time picker for wpf application.please help.
|
|
|
|
|
this is C# Forum. please put it on WPF Forum
cheers,
Abhijit
|
|
|
|
|
|
This is a feature I've seen with the picture control on VB, but could I do that with text boxes or buttons on C#?
I´m trying to change some properties of textboxes but I want to use iteration. For instance, I want to assign the for cycle counter's value to each textbox and display it. 1 for textbox1.text, 2 for textbox2.text and so on.
If anybody has another method to do this please tell me.
I hope made myself clear and excuse my english.
Regards
Ivan
|
|
|
|
|
You can create an array of pretty much any type (in your case text boxes).
Note: Pseudo Code
TextBox[] myTextBoxes = new TextBox[5]
for(int index = 0; index < myTextBoxes.Length; index++)
{
myTextBoxes[index] = new TextBox();
myTextBoxes[index].Text = String.Format("TextBox #{0}", index+1);
}
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Additionally to what teejayem said: if you want to modify the textboxes of your form, then you can do this:
foreach(Control c in this.Controls)
{
if(c is TextBox)
((TextBox)c).Text = insert_your_text_here;
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you a lot, your aid was really helpful
Ivan
|
|
|
|
|
Hi there.
I have a XML file like this :
<NODE15>
<BOOKMARK16 NAME="Mozilla - Home" HREF="http://en-us.www.mozilla.com/en-US/" />
<BOOKMARK18 NAME="mozillaZine Forums" HREF="http://forums.mozillazine.org/index.php" />
<BOOKMARK19 NAME="Mozilla Support" />
<BOOKMARK20 HREF="http://www.download.com/" />
<BOOKMARK21 HREF="http://firefoxplanet.ir/" />
<BOOKMARK22 HREF="http://developer.mozilla.org/en/docs/Extensions" />
<BOOKMARK23 HREF="http://forums.mozillazine.org/viewforum.php?f19" />
<BOOKMARK24 HREF="https://addons.mozilla.org/en-US/firefox/addon/5229" />
</NODE15>
I want to search in it by LINQ.
I used this code
X_Element = XElement.Load(FileName);
var searchNodes = from nodes in X_Element.Descendants()
where Regex.IsMatch(nodes.Attribute("HREF").Value, "Mozilla", RegexOptions.IgnoreCase)
select nodes;
But there is no data in searchNodes
What's wrong with it ?
Thanks in advance
|
|
|
|
|
Please don't crosspost.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hi
I have a custom control which encapsulates a dropdownlist and label.
when you select an item from the dropdownlist it should autopostback
and change the lable text. But postback (selectionchanged) event is
not working at all.
Here is my code.
protected override void RenderContents(HtmlTextWriter output)
{
this.buildControl(output);
}
private void buildControl(HtmlTextWriter output)
{
Table currencyConverterTable = new Table();
// add a label
// here I am adding a dropdownlist
dropdownlist currencySelector= new dropdownlist();
currencySelector.DataSource = mydatasource;
currencySelector.DataTextField = "CurrencyCode";
currencySelector.DataValueField = "id";
currencySelector.DataBind();
currencySelector.AutoPostBack = true;
currencySelector.SelectedIndexChanged += new
EventHandler(OnSelectedChanged);
// add this dropdownlist to the table
// now render it
currencyConverterTable.RenderControl(output);
}
Shouldn't OnSelectedChanged event be fired?
Thanks,
Toby
|
|
|
|
|
Is the BinaryWriter basically functions the same as the StreamWriter??? Can some give me a brief explanation on each? (believe me I did research, and 0% knowledge from what I have read)
|
|
|
|
|
StreamWriter is designed to write strings (essentially, you will use it to write text files).
BinaryWriter is used to write raw bytes to a file (say you were writing a wav file).
|
|
|
|
|
Seeking help with
(i) method/ c# code to remove every second item in a queue
I tried front.next = front.next.next but it this is removing only one second item just after the first but would like to remove every other second item/element through out the queue.
(ii) c# code for reversing a queue .
|
|
|
|
|
(ii)
A queue is a first in first out type right?
So take a queue that you want reversed and put it into a stack.
Then move the stack to a new queue.
This will reverse the queue.
|
|
|
|
|
How do I put all that into C# code?
|
|
|
|
|
This sounds like a homework problem. Even if someone here did it for you, you still wouldn't be able to do future (and harder!) problems.
Use an easy problem like this to develop your programming skills. Figure out the procedure you'd use to solve this with pen and paper. Then figure out how to implement this algorithm with C#.
|
|
|
|
|
Hi,
I have a textbox and i want to set focus to a particular row in the datagridview.
The row that i want is not the index row(that i know) but the row that has a particular id(column name here)
id first_name last_name
1 nelson paixao <-----index0
4 helen hunter <-----index1
5 mark berger <-----index2
7 seth mayer <-----index3
...
private void ToolStripTextBox_Row_TextChanged(object sender, EventArgs e){// code here}
This is a design issue not very important to me but,
Can anyone help me here?
nelsonpaixao@yahoo.com.br
|
|
|
|
|
Is it possible to read a cookie that a website has created or write a cookie that the same website can use? I mean outside of the website itself? It's my own web site, by the way. I know the names and keys inside it and where it is stored already.
Thanks
Brent
|
|
|
|
|
Hey
I'm new to working with c# and am creating a desktop application which needs to store the source code of html files in a mssql database but i keep getting an error
Incorrect syntax near '<'.
Iv tried using SecurityElement.Escape(theSourceCode) but i get the same error only referencing a '&'
I'm hoping this will be an easy question for some one with a bit of exsperience in c# but is there a function to remove or encode the sql sensitive characters from the string containing the source code
Thanks in advance
Phil
|
|
|
|
|
So, show us your code and we can then see what you are doing wrong.
|
|
|
|
|
phil_mob wrote: is there a function to remove or encode the sql sensitive characters from the string containing the source code
Yes. Use a parameterised query, then the value is escaped automatically.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
"system.formatexception: datagridviewcomboboxcell value is not valid"
DataTypes are correct, it selects the right data too. The selections are pulled from one table, the actual selected value is pulled from another.
Any ideas?
|
|
|
|
|
<scarcasm>
Millions not that you'd be interested.
</scarcasm>
hopefully someone will know where that line came from.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|