|
Hi
I have created a new Project in VS2003, and added a WindowsForm.
I want the to forms to "communicate". When i call from one to another
I usually create:
public static string/bool/int/etc.
But i want it to do it to:
public static void.
I have done it like this,
public static void Hello()
{
HelloWorld();
}
Where the HelloWorld get data from "private void HelloWorld()"
But that does not work it gives me the error:
'SkoleTing.MainForm.XmlData' denotes a 'field' where a 'class' was expected
I have no clue what I can use instead of the "static", because it is obvious
that I cannot use "static" in this case?
Can anyone help me how to do this?
Thanks
QzRz
|
|
|
|
|
|
Yes, it was exactly what I was looking for
Thanks!
|
|
|
|
|
Hello!
I need to set permissions to some registry keys...
Maybe anyone knows how can I do it?
Thanks!
|
|
|
|
|
|
Good day.
My name is Eugene.
I have a problem with WebBrowser control from .NET FrameWork 2.0 in my project.
My project (C#) is Form with WebBrowser control on it.
I'm loading in WebBrowser other project (ActiveX Document DLL from Visual Studio 6.0):
webBrowser1.navigate("C:\\Test.vbd");
Next, I'm receive the event:
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (webBrowser1.Document != null)
{
// trying get public properties of "Test.vbd" project
}
}
All it's well, but webBrowser1.Document property always equal null.
Although the page loaded correct and event is raising, I can't get access
to the "Test.vbd" interface.
When I use old WebBrowser control (from Visual Studio 6.0) in my C# project,
I get access to "Test.vbd" interface with "pDisp" parameter of event:
void objBrowser_DocumentComplete(object sender, AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent e)
{
SHDocVw.IWebBrowser2 pIBrowser = (SHDocVw.IWebBrowser2)e.pDisp;
...
Can you help me? How can I use new WebBrowser control to get access to "Test.vbd" interface?
Thank you.
-- modified at 8:38 Saturday 17th December, 2005
|
|
|
|
|
Hi Im a beginner and I want to ask maybe a strange question.Please dont judge me...Which is the best book for a fast improvment in C#...Thank you very much.
|
|
|
|
|
|
hi all, do any of you have an idea about the methods that used to generate user id?
i think it is called GUID,,
thank you for any help
marmosha
|
|
|
|
|
marmosha wrote: do any of you have an idea about the methods that used to generate user id?
i think it is called GUID
Well, strictly speaking a GUID is a Globally Unique Identifier rather than just a User ID. Of course, you can use them as user IDs, especially if there are many distributed computers generating the IDs because the algorithm used is supposed to guarantee uniqueness.
See: System.Guid.NewGuid[^]
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Hi
I have 90 textbox and I want to manage them
their names are finished with two numbers that help me to manage but I cant call them
I should manage them like this
textbox11.hide();
textbox22.hide(); and so on
how can i manage them by their name???
|
|
|
|
|
Hi!
First of all you should consider modifying your design!
Can you really tell by heart what textbox67 is used for? I strongly doubt that having 90 textboxes on a single form will produce a practical user interface...
Nevertheless, you can iterate over your Form's Controls collection like this:
foreach (Control c in this.Controls)
{
if ((c.Name == "textbox47" || c.Name == "textbox83") && textbox77.Text!="")
{
c.Hide();
}
}
Regards,
mav
|
|
|
|
|
90 TextBoxes on a single form?!?!?! Are all of these textboxes really related to the purpose of the form, or are you dividing the form up into sections with each section doing something different?
Just my humble opinion, but...
Watch as the mouse pointer goes to the Start button, a click is heard, then Control Panels, and again on Add/Remove Programs... Oh! The carnage, as your app is removed by the users because of a clunky, confusing, yet convoluted interface...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I'm using a LookUpEdit in my XtraGrid, which I connect to a datasource at
runtime. When I select a value from the LookUpEdit, everythings fine, the
selected value is shown in the cell, but when this cell loses its focus, the
cell becomes empty.
When I use a ComboBox which I manually fill at runtime, I do not have this
problem.
Any Ideas on solving this problem? Please help me!
Thanks.
NPS.
|
|
|
|
|
Have you set the Properties.DisplayMember & Properties.ValueMember?
|
|
|
|
|
|
Hmm, well that's pretty much all I do.
1) Set the Properties.DataSource
2) Set the Properties.ValueMember
3) Set the Properties.DisplayMember
4) Set up the Properties.Columns
If the data is missing after you move away, is the lookup dataset being closed?
|
|
|
|
|
How can I get the title from a program that is active?
I will develop a program that logs every program that a user have used. For example if someone opens notepad I want to retrieve "Untitled - Notepad"
I'm using .NET 2.0
Thanks!
|
|
|
|
|
You need to use the Windows API to lookup that sort of information, and get an IntPtr to the window
perhaps this[^] will help
kind regards,
g00fy
|
|
|
|
|
<br />
<br />
public class Foo<br />
{<br />
<br />
[DllImport("user32.dll")]<br />
public static extern IntPtr GetForegroundWindow();<br />
<br />
[DllImport("user32.dll", CharSet=CharSet.Auto)]<br />
public static extern uint GetWindowText(IntPtr hwnd, StringBuilder text, int maxCount);<br />
<br />
public string GetActiveWindowText()<br />
{<br />
IntPtr hwnd = GetForegrondWindow();<br />
<br />
StringBuilder builder = new StringBuilder(255);<br />
GetWindowText(hwnd, builder, 255);<br />
return builder.ToString();<br />
}<br />
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
|
That doesn't get the result he wants. To use that method you need a process instance. He wants to get the title of the window the user is interacting with. For that he needs some equivalent of GetForegroundWindow().
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
Hi,
I am trying to change the selection of a combobox but am unable to do so, or that is to say I am unable to figure out what event I need to use or how to do it properly...perhaps a more detailed explanation will suffice.
I have some items in my combobox like:
Item A (1)
Item B (2)
Item C (43)
Item D (57)
When the user selects one I want to place the number that is in parens in combobox.Text.
The problem is I can't seem to figure out how to do this. I used the event SelectedValueChanged but as soon as the event is done, the picked value goes in. Here is the code:
private void _cbo_SelectedValueChanged(object sender, System.EventArgs e)
{
int index1 = _cbo.Text.IndexOf("(") + 1;
int index2 = _cbo.Text.IndexOf(")");
_cbo.Text = _cbo.Text.Substring(index1, index2 - index1);
}
The code works I see the text in the combobox but then it is replaced with what the user selected again.
Any help would be greatly appreciated.
Sean
|
|
|
|
|
you may also need to set one of
SelectedText
SelectedItem
|
|
|
|
|
I have tried messing with those and get some very odd results. I am missing something, I must have the wrong event. Any other ideas?
Sean
|
|
|
|