|
You declare the OnInit and InitializeComponent methods directly inside of a namespace, which is not allowed, as the Compiler message states.
So move the "Web Form Designer generated code" region up past the next brace, so both methods are defined inside the _Default class.
www.troschuetz.de
|
|
|
|
|
Hello from a confused programmer...
I'm having a problem with a custom control of mine.
I have created a UserControl which inherits from System.Windows.Forms.Label.
I have added an custom object property to the control which contains an integer, and I have added a normal integer property to the control.
In the property editor the normal integers current value gets saved when I close the solution, but the current value on the integer on my custom object does not.
Why is that? Do I need to do something special on my custom object - i.e. inherit an interface, use some special attribute.
I can't seem to find anything on the subject.
yours truly
Spif2001
|
|
|
|
|
I've added toolbar to application, added buttons, imageindex, icons to image index (48×48 8bpp) and set ImageIndex property of ToolBarButtons. In the begining it all worked fine. But when I enable visual styles in application icons don't show up on buttons.
When I add another toolbar with buttons and everything and dock it somewhere both toolbars show normal, how they should.
I can't find anywhere answer to this problem so if anyone knows how to fix this please help.
|
|
|
|
|
Does anyone know of a way that I could take an algebraic expression and evaluate it? for example, lets say i had the equation I=Prt (simple interest), and had values for I, r, and t, and wanted to solve for P. Is there anyway this could be done or do i need to write 4 seperate equations and pick the approprite one (if solving for P use I/rt, or if solving for t use I/Pr)
|
|
|
|
|
If the expressions are simple and known beforehand, a simple OOP solution would be: create an interface and implement it with the 4 separate equations on 4 separate classes. Then, you pass an interface reference to the method that needs to call them.
If the expressions will only be known at runtime, a solution could be: http://www.codeproject.com/csharp/runtime_eval.asp[^].
If the expressions are more complex, maybe you'll need to build your own parser.
Yes, even I am blogging now!
|
|
|
|
|
Hi all,have you got any sample code in C# to process with ACCESS database such as:Read,WRite,Delete,etc...using 3 tiers model.Give me please,i know nothing about it,but i need it.Thanks for your helping!
God save all of you!
|
|
|
|
|
tiem wrote:
using 3 tiers model
Well, so long as you have no presentation code in the example ( which you wouldn't ), it'll be suitable for 3 tiered development.
The MSDN is full of examples, I believe you pass the path to the Access DB to a SQL Connection constructor, then treat it as any other DB, passing in SQL, etc.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
You say in your email that you don't have time to look in MSDN. I found this link in less than a minute, using google.
http://visualbasic.about.com/od/usingvbnet/l/aa050303c.htm[^]
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
You say in your email that you don't have time to look in MSDN.
Sounds like a homework assignment coming due huh?
- Nick Parker My Blog | My Articles
|
|
|
|
|
Either way, it's a worry when someone 'doesn't have the time' to use the best tools for the job.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi
i had some add-in project in C#.
When i begin one add-in wizard create for me also setup project.
When i compile this project one create setup.exe file and some other files in Debug folder,further more when i launch this setup.exe file from this folder all work fine, but when i remove this file to an other directory and launching
one rised error "not found ...ini file".My question is "How i should compile my setup project in oredr to setup.exe launching be available without some other auxiliarity files"
Thank.
|
|
|
|
|
I've tried for about all possible functions, searched thru articels, messageboards and the rest of the internet but nothing works.
When my Program starts up, i create a second window (titled Reminder) but hide it immediately. Various timers cause this Reminderwindow to pop up. But if my main window is minimized to taskbar the reminderwindow will also be minimized and visible in the taskbar. So... how do i avoid this so that the remidnerwindow pops up again?
|
|
|
|
|
Setting Form.WindowState to FormWindowState.Maximized doesn't work?
( too lazy to try right now )
best regards,
David 'DNH' Nohej
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
|
oh, I see. Strange behaviour! anyway, I was playing with it... I don't whow what exactly are you doing, bt I made this work:
<br />
private void timer1_Tick(object sender, System.EventArgs e)<br />
{<br />
if(m_popUpForm.IsDisposed)<br />
{ <br />
m_popUpForm = new Form();<br />
} <br />
m_popUpForm.WindowState=FormWindowState.Maximized;<br />
m_popUpForm.Show();<br />
}<br />
where m_popUpForm is protected member and it's basic Form class.
It pops up maximized nicely every tick event... even when "parent" form is minimalized!
Is it behavour tou want? I can send you whole app if you want.
I have to admit it's not the best way how to debug bt it works and time is valuable, so forgive me so unprofessional approach
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
ah. Now i found the Problem.
I had the set the WindowState, Show the Form and Activate it.
[Form.WindowState=FormWindowState.Normal;
Form.Show();
Form.Activate();]
The Problem occurs when you generate a hidden
Winform on startup
Subform blah = new Subform();
blah.Hide();
and then try to show it when the main Form is minimized
private void button1_Click(object sender, System.EventArgs e) {
this.WindowState = FormWindowState.Minimized;
blah.WindowState = FormWindowState.Normal;
blah.Show();
blah.Activate();
}
It won't show up without bla.Activate();
|
|
|
|
|
Is it MDI app?
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
What's that?
I just created a new WinForm
|
|
|
|
|
MDI stands for Multiple Document Interface. It's old school way how to organise UI... if interested, check out IsMDIContainer property of Form in MSDN
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
I've an server/client application, for sending single commands to specific clients connected to the server.
The server has an array object with the clients and their informations.
For more detailed informations I have to send a complicated string like "inetStats:PC1!online:PC2!offline"
and then I'm using String.Split(':') btw.: String.Split('!'). (I know it's veeery unprofessional!)
So, I just read about remote objects and MarshalByRefObject and I think it's a rather better way:
With a remote object I could make an array with the inetStates accessible for all connected clients.
I tested it by implementing the code, and it still works fine.
But is that a good idea, making a TCP channel for remote objects next to my Socket connection?
I'd like to replace the socket connection(working with delegates) with the TCP channel method.
But I don't know how to send commands to specific single clients, like in my socket connection?!
I'm looking forward to any suggestions.
(Sry for my bad english )
|
|
|
|
|
I'm not sure exactly what you are asking, however
each client is likely to be on a different IP address, so they can all share the same port number. The remoting call can tell the different between clients.
Does that make sense?
Gary
|
|
|
|
|
What's exactly "The remoting call"? How does the remoting call can tell me the differents between the clients?
Thx for (trying to) helping me.
Knack
|
|
|
|
|
Here's how I would do it.
The Server, waiting for a client to connect (similar to what you do now with the sockets). When the client connects you can determine (or pass) the IP address of the client. When the "server" wants to talk back to the client, it makes a remoting call to the <ip address="" of="" the="" client="">/Object so it can talk to a single client.
Gary
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'
- Dilbert
|
|
|
|
|
yes, that's the way I want to do it.
But how would you let the server listen for any clients, like that?
-------------------------- server code snippet-------------------------------------------------
m_socListener = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint ipLocal = new IPEndPoint (IPAddress.Any, port);
m_socListener.Bind (new IPEndPoint (aryLocalAddr[0], port));
m_socListener.Listen (maxClients);
m_socListener.BeginAccept (new AsyncCallback (OnClientConnect), m_socListener);
-------------------------- server code snippet-------------------------------------------------
|
|
|
|
|
(my client connection part
-------------------------- client code snippet-------------------------------------------------
m_socClient = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPAddress ip = IPAddress.Parse (remoteIP);
IPEndPoint ipEnd = new IPEndPoint (ip.Address, port);
m_socClient.Connect (ipEnd);
-------------------------- client code snippet-------------------------------------------------
And I have to use a tcp channel for marshaling objects, right?!
right after listening on socket the server opens a tcp channel for remote objects:
|
|
|
|