|
Why did your username change ?
Buy a book, that's ground level stuff, if you don't know it, you should be buying a book anyhow.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hope u din get my question
actually i need some sample questions those can be don by control structures.....
if anyone do this program thy should hv more knowledge abt that ctrl structure....
i need to make test to my staffs so i asked,,
self confidence+hard work=SUCCESS
|
|
|
|
|
Murali.S wrote: i need to make test to my staffs so i asked,,
Check out http://www.questpond.com/[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
hi all
good morning.can anyone tell me how to apply styles to a grid control.
i want a design like this.
i have a grid control in which the header should be displayed in a different style and the contents in another style.(i have tried applying styles through stylesheet but it is not working with grid.)how to set the style only for the header in the grid.
i have set the paging property of the grid.i want to display in the footer of the grid as follows.
"Records: 1 to 10 of 25 - Pages: 1|2|3"
pintoo
|
|
|
|
|
I have a C# class library (MyInterop.dll) with interface method for COM Interop. I have VC++ app which will load the C# library and invoke the methods at run time.
I know that if i use #import (MyInterop.dll) and then CreateInstance() to invoke the interface method it works. But my requirement is to load the dll at run time. hence i cannot use #import()
VC++ program will know only the dll name. Based on the DLL name i tried to use LoadTypeLib(), GetTypeAttr() to get the CLSID. And then based on the CLSID i want to create an IDispatch instance
CoLoadLibrary(), GetProcAddress(), ClassFactory(),
CreateInstance(, IID_IDispatch, &m_dispatch)
The call to LoadTypeLib("MyInterop.dll") returns Error loading type library/DLL
Please help
Thank you
|
|
|
|
|
Hi,
Is it possible to create user-defined controls (.ascx file) and use them in windows applications. If so can anyone provide links, resources.
Thanks and Rgds,
PLS
Long Live
|
|
|
|
|
No. You can create user defined controls, but they can't be ascx files, they need to be winforms controls.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Thanks Christian Graus.
Long Live
|
|
|
|
|
Hello I am new to this forum... I have a quick question... well I've created a Address Book, basically as my first program that I want to show my family.. On the first form it is all textboxes, datatimepicker, and a picturebox.
You click the menu to open the DataGrid form I created.. in this I have a DataGridView. I have two problems. The DataGridView is always missing the first row of data. ID is the primary key and auto increments. It is always missing the first one... Also how do I get the table to display the image they chose with the person they added? I have the column as a image column but it will not display. The Picturebox is in the database. Here is how they load the picture:
try
{
DialogResult result = new DialogResult();
OpenFileDialog openfile = new OpenFileDialog();
result = openfile.ShowDialog();
if (result == DialogResult.Cancel)
{
return;
}
else
{
picturePictureBox.Image = Image.FromFile(openfile.FileName);
}
}
catch (Exception ex)
{
toolStripStatusLabel1.Text = ex.Message;
}
One --> how come the datagridview is missing a row all the time?
two --> how do I get the picture to display in the datagridview?
I will be adding something where they can print the information in this format:
FirstName LastNAme
Address
City, State Zip
Home Phone, Cell Phone, Fax
I will get to this later, I am goign to try to figure that one out myself, but with the datagridview and the picture I have been messing with for a while and can just not figure it out.. Thanks
|
|
|
|
|
Hi,
two --> how do I get the picture to display in the datagridview?
maybe this can help you
|
|
|
|
|
|
TextBox get focus always, like msn messager's input-box.
How to do?
|
|
|
|
|
Probably call SetFocus each time the textbox is no longer in focus.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi,
My C# code calls to bunch of external methods exported from gdi32.dll
That’s example of the code we use to export the methods from the dll:
[DllImport("gdi32.dll")]<br />
internal static extern int ExtEscape(HDC hDC, <br />
int nEscape, <br />
int inputSize,<br />
ref CWDDECMD InputData, <br />
int outputSize, <br />
ref CIWSINFO OutputData);<br />
<br />
<br />
…<br />
[DllImport("gdi32.dll")]<br />
internal static extern int ExtEscape(HDC hDC, <br />
int nEscape,<br />
int inputSize,<br />
ref CWDDECMD InputData,<br />
int outputSize,<br />
ref CIOVLTHEATERMODE OutputData);
There are over two hundred of method declarations and they are different only by type of parameters (ie CIWSINFO versus CIOVLTHEATERMODE in this examle).
The methods are called from all around the code.
Now I have to come with design that allows tracing calls to the methods
While printing the name of the method and type and values of passed parameters (this part is simple as each passed type implements ToString method).
I just hate idea of duplicating each declaration with the method that performs tracing before calling to real method:
[DllImport("gdi32.dll")]<br />
internal static extern int ExtEscape(…);<br />
<br />
static int ExtEscapeTrace (…)<br />
{<br />
DoTrace ();<br />
ExtEscape (…) ;
}
To bad the methods are static; otherwise I would be able to use proxies.
Any ideas?
|
|
|
|
|
Hi,
I am trying to get status text of the browser using following code but for some reason I am not getting any values back. Any idea why?
// both lines doesn't work
string result = webBrowser1.Status.Text;
string result = webBrowser1.Document.Window.StatusBarText;
Thanks
A.Asif
|
|
|
|
|
|
|
I've been using the WMI code generator to get my start, but I'm having trouble figuring out how to implement WMI in C# on my own.
I've figured out that what I'll probably do to check who is logged on the computer remotly is use:
-Win32_Process, filter where name='explorer.exe'
And then:
-GetOwner
to throw back the username.
Are u familiar on how to implement WMI in C#? I could really use a hand.
|
|
|
|
|
try this. I got the code snippet from the code generator itself. However, makesure you know which Win32_Process.Handle you want t10execute GetOwner on. In the code snippet its tied to 1076.
using System;
using System.Management;
using System.Windows.Forms;
namespace WMISample
{
public class CallWMIMethod
{
public static void Main()
{
try
{
ManagementObject classInstance =
new ManagementObject("root\\CIMV2",
"Win32_Process.Handle='1076'",
null);
// no method in-parameters to define
// Execute the method and obtain the return values.
ManagementBaseObject outParams =
classInstance.InvokeMethod("GetOwner", null, null);
// List outParams
Console.WriteLine("Out parameters:");
Console.WriteLine("Domain: " + outParams["Domain"]);
Console.WriteLine("ReturnValue: " + outParams["ReturnValue"]);
Console.WriteLine("User: " + outParams["User"]);
}
catch(ManagementException err)
{
MessageBox.Show("An error occurred while trying to execute the WMI method: " + err.Message);
}
}
}
}
|
|
|
|
|
I want to user only enter integer for the employeeID property but when i enter alpha-numeric the messagebox appears twice. I want to display once what's wrong.
[TypeConverter(typeof(TypeConverters.MyIntConverter)),Browsable(true)]
public int EmployeeID
{
get { return _empID; }
set { _empID = value; }
}
=========MyIntConverter Class==============================
public class MyIntConverter : System.ComponentModel.Int32Converter
{
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value is string)
{
try
{
return int.Parse(value.ToString());
}
catch(Exception)
{
MessageBox.Show("Invalid Number");
return 0;
}
}
return base.ConvertFrom(context, culture, value);
}
}
|
|
|
|
|
This code will only show one, so it must be getting called twice. Try setting a breakpoint and checking the call stack to see why it's called twice.
Also, if you're going to use a value, use as instead of is, it's more efficient. And I'd recommend int.TryParse instead of a try/catch.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I feel like pulling my hairs have already spent 2 hours... I have only one propertyGrid on a form and even test on a brand new project still am getting the Messagebox twice. What i notice is that somehow it's coming twice in the Catch block. I do'nt know where else to dig.
|
|
|
|
|
Look at the call stack to see who is calling the method each time. One of the callers is presumably unintentional.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
What i have discovered is that when the when the debugger hits to the MessageBox.Show inside the catch block it goes back to the start of the function and then start all over again. I couldn't figure out why is it behaving like this. If i remove the MessageBox.show then it works fine but i want to display my customize error message.
Line 24 is where my MessageBox.show is defined
========Below are the call stack i got==================
myHelp.exe!TypeConverters.MyIntConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context = {System.Windows.Forms.PropertyGridInternal.PropertyDescriptorGridEntry EmployeeID}, System.Globalization.CultureInfo culture = {en-US}, object value = "9s") Line 33 C#
[External Code]
myHelp.exe!TypeConverters.MyIntConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context = {System.Windows.Forms.PropertyGridInternal.PropertyDescriptorGridEntry EmployeeID}, System.Globalization.CultureInfo culture = {en-US}, object value = "9s") Line 24 + 0xb bytes C#
[External Code]
myHelp.exe!TypeConverters.MyIntConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context = {System.Windows.Forms.PropertyGridInternal.PropertyDescriptorGridEntry EmployeeID}, System.Globalization.CultureInfo culture = {en-US}, object value = "9s") Line 24 + 0xb bytes C#
[External Code]
myHelp.exe!myHelp.Program.Main() Line 17 + 0x1a bytes C#
[External Code]
I get this message when i do MessageBox.Show(e.StackTrace.Tostring());
at System.Number.StringToNumber(String str,NumberStyles options, NumberBuffer& number,
NumberFormatInfo info, Boolean ParseDecimal at System.Number.ParseInt32(string s,
NumberStyles style, NumberFormatInfo info) at System.Int32.Parse(string)
at TypeConverters.MyIntConverter.ConvertFrom(ITypeDescriptorContext context,
CultureInfo culture, Object value) in Document\Project\MyIntConverter.cs line 20
|
|
|
|
|
I'm guessing you have more than one event handler calling the method.
At any rate, consider using a NumericUpDown rather than a TextBox, or write a KeyPress event handler to ignore characters you don't want.
|
|
|
|