|
Please don't crosspost. If you Google a bit you'll find the format[^]. You read it in the same way as a textfile, and display it on a form.
Good luck.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi, i have a problem with my WindowsForms Application.
I have a Form with various controls which change size when the user changes the size of the Window. That works and i used Anchor and Dock properties to realize that.
The application has different languages and two buttons to chose the current language which works also with that kind of code:
private void LoadLanguage( string Language)
{
ComponentResourceManager Resources = new ComponentResourceManager(typeof(Form1));
CultureInfo CultureInfo = new CultureInfo(Language);
doRecursiveLoading(this, CultureInfo, Resources);
}
private void doRecursiveLoading(Control Parent, CultureInfo CultureInfo, ComponentResourceManager Resources)
{
foreach(Control c in Parent.Controls)
{
Resources.ApplyResources(c, c.Name, CultureInfo);
if (c.Controls.Count > 0)
doRecursiveLoading(c, CultureInfo, Resources);
}
}
But now i get a problem: My init state is a solution of 1280x1024. When i maximise the window to Fullscreen on HD-Monitor and then click the button for changing the language it changes the language but it also resizes all my controls to the inital size they had at a resolution of 1280x1024 and not the size they should have at fullscreen.
Hope you can understand my problem and some of you has an idea how to fix that.
Thannks in advance.
Chrissi
modified 5-Aug-14 3:35am.
|
|
|
|
|
ChriSSi003 wrote: Hope you can understand my problem and some of you has an idea how to fix that. If "all" controls resize to a max (as opposed to filling the form) while using docking, then there's probably a panel in there that's not docked correctly to "fill".
Take in account that when localizing size and location is localized with it. Often a button becomes larger or smaller due to a different caption, same for labels and the likes. The IDE will put those also in the resource-dll if you are using the IDE to do the translation.
int curlang = 0;
List<string> langs = new List<string>(new [] {"nl-NL", "en-GB", "en-US" });
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
ComponentResourceManager Resources = new ComponentResourceManager(typeof(Form1));
CultureInfo CultureInfo = new CultureInfo(langs[curlang]);
Resources.ApplyResources(button1, button1.Name, CultureInfo);
curlang += 1;
}
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
It is likely caused by
Resources.ApplyResources(c, c.Name, CultureInfo);
The resources contain information about the size, and that size is now applied. So I suggest to remove the size and position information from the resources (but then you have to make sure that the controls are well sized for any of the languages supported).
|
|
|
|
|
Can you tell me where to find the information about size?
In my two .resx files for German and English language i dont have any information about size or position.
So i think it has to come out of the ComponentResourceManager thing.
ComponentResourceManager Resources = new ComponentResourceManager(typeof(Form1));
I tried to find information about size in that but it seems so big and complex that i don't know where to look.
Maybe you can help me where to find it.
Thanks in advance.
|
|
|
|
|
What do you need to change with the languages? If it is text only, I'd suggest to set it rather "directly":
c.Text = Resources.GetString(resourceName, CultureInfo);
(resourceName is likely c.Name, but I am not sure with this point).
instead of
Resources.ApplyResources(c, c.Name, CultureInfo);
|
|
|
|
|
Bernhard Hiller wrote: c.Text = Resources.GetString(resourceName, CultureInfo);
Thanks a lot. That works the way I need it.
|
|
|
|
|
So I'm getting my feet wet in .net 3.5 in VS 2008.
Made a form with a button to open another form.
On the called form. I close the form. Simple enough.
I build the exe
I start the program (watch memory usage in task manager),
click the button to open the other form (watch memory in task manager),
then close the form (watch memory in task manager).
Keep repeating. Memory usage just gets larger.
Button click does this: foo_form.show()
Use the window close [X] top right of form.
Looks like memory is leaking.
Don't rememebr vb6 doing this.
Many thanks.
|
|
|
|
|
My guess is that the memory usage hasn't grown enough to trigger the garbage collector.
You could try calling Dispose() on the second window after it closes and see if that has any effect.
You could also try "manually" invoking garbage collection after the second window closes (first setting any references to it to null).
|
|
|
|
|
Thank you. Seem to remember something about garbage collection
being automatic. The environment looks pretty slick. Should
be lots of fun.
|
|
|
|
|
Bret Stern wrote: watch memory in task manager),
There's your first mistake. Task Manager is not showing you how much memory your application is using, but how much the .NET CLR has RESERVED for your application. Use the .NET Memory counters in PerfMon to find out how much memory your app is actually using.
By reserved, I mean your application can free memory that it isn't using any more but that memory goes back the Managed Heap for future allocations. It will not be freed back to Windows unless the CLR deems that it doesn't need the memory or Windows starts to run low on memory and requests that the .NET CLR frees up whatever it can.
The is a completely automatic process and the .NET Memory Manager does it's job very well. You do not need to worry about freeing up the memory yourself.
Next, this depends on what you're using to show the second form. If you use the .ShowDialog() method on your form instance you MUST call Dispose() method on the form instance when you're done with the form. If you don't do this you WILL run into memory and handle issues, possibly running Windows out of resources.
Oh, and do NOT call GC.Collect() unless you know exactly why you're doing it and understand completely the impacts on the GC. You can easily negatively impact the performance of your application by calling Collect unnecessarily.
|
|
|
|
|
Not use to the memory babysitting. Thanks for the explanations.
|
|
|
|
|
I have to track the lists of all the visited urls from any browser like Internet Explorer, Mozilla Firefox, Google Chrome, Opera etc.
To get the all opened tabs in the Internet Explorer, I have used the below codes :
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
string filename;
ArrayList windows = new ArrayList();
foreach (SHDocVw.WebBrowser ie in shellWindows)
{
filename = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
if (filename.Equals("iexplore"))
{
Console.WriteLine("IE Url for '" + ie.LocationName + "' is " + (ie.LocationURL));
}
}
But my question is that how can I get this same all the opened tabs description from other browser?
I have found the below code to get the only one tab which is open in the browser.
using DDE to get the current tab.
private string GetBrowserURL(string browser)
{
try {
DdeClient dde = new DdeClient(browser, "WWW_GetWindowInfo");
dde.Connect();
string url = dde.Request("URL", int.MaxValue);
string[] text = url.Split(new string[] { "\",\"" }, StringSplitOptions.RemoveEmptyEntries);
dde.Disconnect();
return text[0].Substring(1);
}
catch {
return null;
}
}
I have checked WinPCap, SharpPcap, Pcap but could not get the right solutions to solve the issue.
I need a source code using c# which will be running successfully in .Net 2.0 framework to get the all visited urls lists from all the browser.
Please help me to solve this issue.
|
|
|
|
|
Member 10501211 wrote: I need a source code using c# which will be running successfully in .Net 2.0
framework to get the all visited urls lists from all the browser. Impossible.
I'm often using Lynx, simply because it's not one of the most often used browsers
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You cannot do this by writing a single piece of code.
Every browser stores its history differently. You're going to have to write different code for every browser you want to support.
|
|
|
|
|
You need a totally different architecture.
In the local network, install a proxy server. Setup the network such that all computers have to use the proxy server to reach addresses outside the LAN.
In the proxy server, enable logging. Now you only need an application for reading and analysing that log file.
|
|
|
|
|
It'd be much easier to just setup a span port on the LAN and run Snort, Bro, etc. Can always do Security Onion or similar as well to get a full spectrum look at traffic.
This does assume static IP, of course.
|
|
|
|
|
can anyone help me to create .exe while creating exe its asking demo version sherdian controls i tried many things like threed32.ocx regedit etc but all in vain
error : licensed not found
|
|
|
|
|
|
hi alla
need some suggestion from you to develop a application
i have been assigned to code a application which will be used by the data entry to key-in the information and generate the reports.
the data at present keyed in as below
ITEM FORMULA vALUE
A A 7
B (A*2) 14
C c 3
D D=A+B+C 24
E E 2
F F=D+E 26
G F*5*2*3/1000 0.78
THE Aboave is the data been present keyed in Excel i am been assigned to develop a application. They have so many sheets with these formula..
i am not able to decide as to take these things a columns or rows. as the formula need to be executed and these formula get changed sheet to sheet.
This need to be achieved with SQL & .Net please kindly guide for how to go ahead coing i can do but i just need the logic.
thanks
kumar
|
|
|
|
|
TNKumar wrote: i can do but i just need the logic. Logic for what? All you have told us is that you have to develop an application, no information on what it is supposed to do.
|
|
|
|
|
hi
i am been told to develop
i need your suggestion how to execute this formulas if i take them as records are should i take them as columns.....as this is a sample there are about 60 lines like this
please kindly suggest
|
|
|
|
|
As I said before we have no idea what you are trying to develop. Either explain what your program is supposed to do, or talk to your manager and ask them.
|
|
|
|
|
Hi
My Program has to do the calulation
A A 7 - Entered
B (A*2) Formula need to be calculated
C c 3 - enttered
D D=A+B+C Formula need to be calculated
Is there any way or process where the Formula stored in a record can be calculated with passing values.
Thanks
|
|
|
|
|