|
I'm creating an user control like treeView, in this control, I want to put a button to let my user control hide/show in Owner form.
how could I do?
thanks
|
|
|
|
|
|
Just delete it in C# forum
|
|
|
|
|
|
kenmaMoon wrote: how could I do?
Toggle the Visible property?
The problem is a logical one; if you hide the control containing the button to toggle visibility, the user will not be able to make it visible again, as the button that toggles it is invisible too.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
thanks for your reply.
yes, but the button is in the userControl, next time I want the user control shown by click the button.
|
|
|
|
|
kenmaMoon wrote: yes, but the button is in the userControl, next time I want the user control shown by click the button.
Re-read what I wrote; the button will be invisible if you hide the container it's in. You cannot click an invisible button.
Either put the button somewhere else and have it toggle the Visible property, or put the button somewhere on location (0,0) and resize the control to shrink to the size of the button.
Third, best option; throw the button and the control you wish to show/hide on a new usercontrol.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I am working on a heavily used winform C# application.
I have a user control, that has 3 textboxes and it can contain another user control. user can add n number of main user control on the form. due to this, if the user adds more than 20 controls, after the 20th control, the UI doesnt show anything. It is not giving any exception, its simply not drawing the controls? My application is not exceeding GDI objects
Also the textbox is using WPF textbox.
All suggestions welcome. Thanks.
|
|
|
|
|
Member 7834460 wrote: after the 20th control, the UI doesnt show anything.
Does that mean that "20 items" is the maximum that "fit" on your form? It might be creating the rest of them on the non-visible area.
Does it have a ScrollViewer where you put the children in? Any scrollbars set?
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello!
Gray BackColor is not suitable for my application GUI. Tell me how it is possible to change the background color of the control.
|
|
|
|
|
So what happens when you change the value of the BackColor property?
|
|
|
|
|
Nothing ... )) msdn: "This member is not meaningful for this control"
|
|
|
|
|
Did you read this[^]?
You'll have to custom draw the tab control yourself to change the color.
|
|
|
|
|
I'm using Visual C# 2010 Express.
I've written code to display Provider maps on my form.
I can draw lines on the maps, and capture the latitude / longitude from the map.
My problem is that when I pan or zoom the map, my drawn line stays in one place; it doesn't move or resize with the map.
I'm using a gMap control to load the provider maps as below:
private void Form1_Load(object sender, EventArgs e)
{
gMapControl1.MapProvider = GMap.NET.MapProviders.ArcGIS_Topo_US_2D_MapProvider.Instance;
GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
gMapControl1.Position = new GMap.NET.PointLatLng(39.401389, -077.986111);
gMapControl1.Zoom = 10;
I've created an Overlay for my form, and I'm drawing on the overlay as below:
private void graphicalOverlay1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
Pen fl = new Pen(Color.Red, 3.0f);
e.Graphics.DrawLine(fl, x_start, y_start, xx, yy);
}
Perhaps I shouldn't be drawing on the Overlay. But I don't know how to just draw on the providers image.
Any direction to "lock" my drawn lines with the map would be appreciated.
Thanks
AW
|
|
|
|
|
e.Graphics.DrawLine(fl, x_start, y_start, xx, yy); uses pixel values, not geo coordinates. You have to get the latitude/longitude values for your lines, the transform them into pixels using the zoom and offset values of the underlying map.
|
|
|
|
|
Bernhard;
Thank you for reading my post question and replying.
I'm getting the lat/long coordinates with this:
private void gMapControl1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
double lat = gMapControl1.FromLocalToLatLng(e.X, e.Y).Lat;
double lng = gMapControl1.FromLocalToLatLng(e.X, e.Y).Lng;
This returns decimal degrees which I then convert to dd-mm-ss.sss.
I was using the following to paint my lines on the provider map, which does work to paint the lines;
private void gMapControl1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
Pen fl = new Pen(Color.Red, 3.0f);
e.Graphics.DrawLine(fl, x_start, y_start, xx, yy);
But x_start, y_start, xx, yy are nothing more than screen coordinates; just like with the overlay code. And when I pan or zoom, the map moves but my drawn lines stay in the same place relative to the screen.
x_start = e.X;
y_start = e.Y
Are you saying that I need to pass the geo coordinates to xx, yy to draw the lines on the providers map?
I don't understand your statement; "then transform them into pixels using the zoom and offset values of the underlying map".
|
|
|
|
|
Oh, I think I understand what you meant!
I need to do something like
Double map_x equals gMapControl1.FromMapLatLngToLocal(PiontLatLng Point);
Then when I pan or zoom, just redraw my lines.
Can you provide the proper syntax for MapLatToLocal ?
|
|
|
|
|
That's the way to go. But I do not know the functions provided by the control. Why don't you ask the author - there is a section below his article for taht purposes, isn't it?
|
|
|
|
|
people often develop chat apps and they display chat conversion between two people in simple text box or rich text box. i want to develop a chat apps where i want to design chat conversion UI area look like Skype.
1) Skype chat conversion area show the conversion where other user name show as with different color
2) user can copy text from chat conversion area by mouse selection
3) chat conversion area is capable of showing emoticons.
4) chat conversion area can show progress bar when one user send file to other then progress bar is show at two end.
so here i am uploading few screen shot of Skype chat conversion area as a result you guys can visualize and can understand what kind of UI i want to develop. please click on the two link to better understand what i am talking about.
http://social.msdn.microsoft.com/Forums/getfile/262465[^]
http://social.msdn.microsoft.com/Forums/getfile/262468[^]
the problem is i am not being able to take decision how to develop chat conversion window where i need to show chat conversion data between two user and user name too. also that area must have capability of showing emoticon and progress bar and images.
so just suggest me which control i should use to develop chat conversion windows.
1) should i use rich text box ?
2) should i use datagridview ?
2) should i use web browser control ?
i need something which can show user name and user chat data and also emoticon and progress bar.
please guide me how to develop. if possible give me some c# code. thanks
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: please guide me how to develop Use a rich-text box. Hardest part in a chat-application will be the server. After that, it's doing the messaging on a background-thread in the client, to keep the UI nicely responsive. The UI itself is hardly relevant at that point.
I'd start with a plain textbox; once it works, make a backup. Then yank out that textbox, plugin a RTB. Or a WebBrowser. Or something more complex. (FWIW, example seems like a list of a custom-control, consisting of 2 labels and a HTML-capable label in the middle)
The datagridview would be the fastest of those controls. The browser would be ideal, given that you can simply embed emotes as pictures in the text.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
u said :- FWIW, example seems like a list of a custom-control, consisting of 2 labels and a HTML-capable label in the middle
what is the meaning of FWIW? where to download it.
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: what is the meaning of FWIW?
FWIW is "For What It's Worth". You can build a UserControl, drop two labels and a browser on there, and you'd have something similar.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have a WinForms application that moves a group of points around with the mouse. The code has worked fine on Win 98, XP and Vista. It was slow under Win7, until I disabled the Aero stuff and then it was fine there, too. Now under Win8 it's acting just like on Win7 with Aero activated.
I've checked to make sure the graphics drivers are updated, and even gone to Control Panel and set things for Optimum Performance rather that Optimum Appearance. No difference at all.
Does anyone know what might be done? This is a show stopper! The program uses plain GDI and is in C#.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Disable Aero for Win8
modified 19-Apr-13 15:36pm.
|
|
|
|
|
If you figured out how to disable Aero in Win 8, I'd love to hear about it. I thought about that first.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|