|
Member 11059799 wrote: It's very presumptuous of you to think I presumed nothing, but I can only base my responses on the information you provide. If it's not clear then I ask for clarification, which I did in several responses. If you can't understand my questions then you can do the same. I'm sorry that I could not provide all the information you wanted, but I did (I thought) make it clear on my part that I did not fully understand what you were asking for. And I'm sorry that you seem to think that you are not getting the value for money that is your due, but we do this in our own time and at no cost to you.
|
|
|
|
|
Member 11059799 wrote: If yes how is it done in VS C#? You'll have to WRITE it.
And no, there's very little chance that anyone has done "exactly" what you need, so you search for an example that comes close and start there. Start here[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Well that was no help at all. You think I didn't search for something close? I stepped through every one of those articles with tags VS, C#, and SQL. Not only is there nothing close but nothing near the planet and there isn't a Tag for Winforms.
The project Social.Club might be useful but I can't get it to load and build per the instructions. Perhaps because I have VS 2013 and not VS 2010. Not sure. In any event it doesn't look like it contains an example of user text input to scroll the Tree display.
Regards,
Thom
|
|
|
|
|
Member 11059799 wrote: Not only is there nothing close but nothing near the planet ..there's quite some examples out there on searching, also including WinForm-treeviews. Like I already said, we don't have examples on each scenario. Filtering would be harder to implement than searching; searching a single item and highlighting it would be a lot easier to start with.
- Nodes.Find[^]
- Looping all nodes yourself (recursively!) and checking it (will be harder if the tree lazyloads, and should ideally be done on the datasource, not the tree itself)
Member 11059799 wrote: In any event it doesn't look like it contains an example of user text input to
scroll the Tree display. "Finding" an item in a tree requires a textbox for a search-term, and invoking the Find method. Highlighting that node should bring it into view.
--edit;
Simplest example I could come up with is given below. Do mind the difference between a node-key and its caption. Keynames should be unique, captions don't have to be. Anyting with more flexibility requires more coding.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
static class Program
{
static void Main()
{
using (var f = new Form())
{
var tb = new TextBox() { Dock = DockStyle.Top };
var tv = new TreeView() { Dock = DockStyle.Fill };
f.Controls.AddRange(new Control[] { tv, tb });
tv.Nodes.Add("one", "one").Nodes.Add("two", "two");
tv.Nodes.Add("three", "tree").Nodes.Add("nine", "nine");
tv.Nodes.Add("tree", "three").Nodes.Add("oak", "oak");
tb.KeyDown += (o, a) =>
{
a.Handled = a.KeyCode == Keys.Return;
if (a.Handled)
{
TreeNode[] foundNodes = tv.Nodes.Find(tb.Text, true);
if (foundNodes.Length > 0)
{
tv.SelectedNode = foundNodes[0];
tv.Focus();
}
}
};
f.ShowDialog();
}
}
}
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
modified 8-Sep-14 14:54pm.
|
|
|
|
|
I would recreate a new tree-view and fill it with items found. Then switch the between the two different tree-view controls.
lol, just noticed the date. Why do they have 14 year old threads on here..
Schneider
|
|
|
|
|
Hello,
Sometimes coding in C#, you can't see the forest for the trees. I'm sure the answer is ridiculously simple, but it has me baffled.
On a windows form, the user clicks a toolstrip item which opend a dropdown list. The user clicks a selection, dropdown list disappears, and the selected item displays towards the top. To get rid of that displayed item, you have to click anywhere else on the form.
All I'm trying to do is when the user clicks their selection, close (wrong word?)down the display for that toolstrip item. (Act as if I clicked on a different portion of the form.)
Thanks in advance.
|
|
|
|
|
You could try selecting another control by doing theControl.Select() .
/ravi
|
|
|
|
|
Thanks Ravi, but I get the same results.
Researching the problem, it's comforting to know that I am not the only one experiencing this problem. Other users experiencing the same problem seem to report "it doesn't work" to other offered solutions. I found an old post with an answer by a Microsoft employee stating, "It's by design." Well even so . . .
Kevin
|
|
|
|
|
Ravi, My apologies. I'm unfamiliar with this messsage board and I hit a "down arrow" icon thinking it would scroll down to the next message. Turns out it gave you a thumbs down for your answer, which was definitely not my intention. - Kevin
|
|
|
|
|
No worries.
/ravi
|
|
|
|
|
If I understood your question correctly, you have a ToolStripComboBox as an item of a ToolStripDropDownButton and want to close dropdown when an item of combobox is selected; so you can do this:
private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
((ToolStripItem)sender).PerformClick();
}
|
|
|
|
|
Hello
I have a strange problem with the configuration of an application written in c # winform.
I wrote a simple application that reads some records from a table in sql remote. in the App.config file I wrote the connection string and everything works.
I copied the bin folder on another pc and for error I renamed the configuration file <apptext> .exe.config in <apptext> .exe.conig
I run the application and the application rightly gave me error because it could not find the config file. I renamed the file correctly and everything works fine.
What happens: :mad:
randomly when I do a restart of the PC, I find myself in the bin folder
the configuration file wrong, what I had written the first time <apptext> .exe.conig
Can anyone tell me how to solve this problem?
thank you
|
|
|
|
|
First you have to find out why it is getting renamed in that way, and there could be many reasons. Without access to your pc it is not possible to guess.
|
|
|
|
|
thansk for reply
is a week that I'm trying to understand what happens
by the time I solved by copying the configuration file at to the start of the application
but it's not good
the operating system is windows 7 and I just can not understand on what happens.
perhaps the first time, it was put configurator wrong in some cache
and when restart the PC overwrites the existing one.
I also removed the write permission to all users, including Administrator and System,
the problem remains
|
|
|
|
|
I can only assume that you are running this in Visual studio and regenerating the file when you restart your PC. Check all the settings in Visual Studio to see that it does not have a reference to the "wrong" name.
|
|
|
|
|
Hi Richard
thanks again for replay
No, the application is not launched from Visual Studio
I wrote, compiled and put on a pc
And i checked into reference but nothing
the strange thing is that it reappears old configurator
even now he did .....................
I'm going crazy
thanks
|
|
|
|
|
Sorry, but there is nothing we can suggest without a lot more information.
|
|
|
|
|
Thanks for your time
I solved the problem
|
|
|
|
|
hi does anyone know how i can disable the animation which happens to a windows form when the this.hide() is used?
i am trying to do this without using thread.sleep.
i am using vs.net 2012. thanks and any help is appreciated.
|
|
|
|
|
neodeaths wrote: hi does anyone know how i can disable the animation which happens to a windows
form when the this.hide() is used? I haven't tried it, but I guess it'd be the performance options of Windows. There's a setting in the system-page somewhere that let's the user decide between "cool" (animations, shades and stuff) and "fast" (no animation, no shades). Or to let Windows decide. AFAIK, it's a settting that would change the behaviour for ALL applications.
neodeaths wrote: i am trying to do this without using thread.sleep. Try clearing the .Controls collection and making the form 100% transparent. "Hide" it after that.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Maybe this help:
enum DWMWINDOWATTRIBUTE : uint
{
NCRenderingEnabled = 1,
NCRenderingPolicy,
TransitionsForceDisabled,
AllowNCPaint,
CaptionButtonBounds,
NonClientRtlLayout,
ForceIconicRepresentation,
Flip3DPolicy,
ExtendedFrameBounds,
HasIconicBitmap,
DisallowPeek,
ExceludedFromPeek,
Cloak,
Cloaked,
FreezeRepresentation
}
[DllImport("dwmapi.dll")]
private static extern int DwmSetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE attr, ref int attrValue, int attrSize);
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
if (Environment.OSVersion.Version.Major >= 6)
{
int attrValue = 1;
int hr = DwmSetWindowAttribute(this.Handle, DWMWINDOWATTRIBUTE.TransitionsForceDisabled, ref attrValue, 4);
if (hr < 0)
Marshal.ThrowExceptionForHR(hr);
}
}
|
|
|
|
|
Hello All,
It has been some time since I have been here. I am currently stumped and think this should be easy.
I have a C# windows form with a pretty generic datagrid displaying the contents of 1 table.
I can update/add & delete data in the grid no problem.
My issue is I have a password field field in the table that is hidden.
I've added a text box and an update pwbutton.
How do I use the existing tableadapter/bindingsource to update a single field hidden in the dg?
(Never mind, figured it out.)
Is there a simple way to update my pw field?
Thanks for any ideas.
modified 30-Jul-14 15:18pm.
|
|
|
|
|
I need to develop a generic XMLEditor Form for an application (Windows Forms .Net 4.0).
The main concepts are:
- xsd definitions are known and stored as a resource
- form receives xml content string and the xsd name
- user must be able to edit (and add/delete) all of the xml attributes / values
Below is a sample of one of the xml content strings
<TechnicalCatalogInfo>
<Properties>
<Property id="1319" name="Some name"><![CDATA[</Property>
<Property id="2715" name="Other name"><![CDATA[</Property>
<Property id="2716" name="Another name"><![CDATA[</Property>
</Properties>
</TechnicalCatalogInfo>
There are 3 or 4 different xml schemas and this form must be able to edit all of them.
Do you think that this can be done?
|
|
|
|
|
Miguel Figueiredo wrote: Do you think that this can be done? Yup.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I am creating setup file with sql server database but i am facing an error...network elated error and i can't get the data from .mdf.deploy file...plz help me...it's my first project on windows based...
|
|
|
|