|
First, do NOT send emails directly to a person. They will get back to your question when they can, NOT when you damand it. Sending me an a direct email to answer your question is extremely rude.
|
|
|
|
|
Relax, mate....I don't think there is an need to get hyper about it.
You have been most helpful in the past. My thinking is that posts that do not see much activity for more than a couple of days seldom get far, I thought it better to jog you into a response.
I am sorry if you take offense at such things.
RB
|
|
|
|
|
I have a datagridview with a button column as one of its column collection. The width of the button column is say 50 but the problem is the button editing control within the cell of that column is also having the same width as its parent column which looks awkward. I want to set the width of the button editing control small enough say 20 irrespective of its parent column width. Please help. Thanks.
|
|
|
|
|
As far as I can find, you'd have to create your own Column and Cell classes to implement this. Creating custom columns is WAY beyond the capacity of a forum post. I'd started by doing a bunch of research on creating custom DataGridView columns. Warning! This is NOT beginner level stuff...
|
|
|
|
|
It's not as simple as it sounds to get control of any window in VB .net.
I googled "getting text from a window" and got good results, but it only works for notepad. It doesn't work for media player.
I want the general control of window. for example what should i do if I want to control Windows Media Player (not the activeX within VB, i am talking about independent windows media player (9 or above) provided by Microsoft) like when i press a button on VB .net form it changes the song in WMP.
So I am calling it the general control. Can anyone tell me all possible controls that VB .net can do with other applications.
|
|
|
|
|
I am not entirely sure what it is that you want to do, but it sounds like you want to write a program with which you can control any other possible program. If that is the case, I seriously doubt it can be done in any sensible way, that is easier than just opening the program in question and pressing its own buttons instead.
The only thing that I can think of that comes even close to this: http://freelabs.info/MacroRecorder.aspx[^]
My advice is free, and you may get what you paid for.
|
|
|
|
|
I'd advise you to start look into hooking WMP.
|
|
|
|
|
Controls can be child windows of other controls, many levels deep. You have a couple of problems. First, it appears that you're only checking top level controls in a form and not the child controls that may be in them.
Also, if the technique you're using refers to WM_GETTEXT, the problem you may run into is that there is nothing that says a control must respond to that message. So, you may not get anything back.
Lastly, this method will not work at all with WPF applications.
Controlling other applications is exceedingly difficult and rarely ever ends up using "production quality" code.
|
|
|
|
|
Hello Experts,
I am designing columns in datagridview at design time and bind data at run time using dataset...But it shows in gridview my columns(designtime) and dataset column at a time. Waht to do with this?
I dont want to change column header order!!
It shows according to database column order!!
Please help!!
|
|
|
|
|
It is difficult to say, without seeing some code, but generally speaking when adding columns to a datagridview, you can determine all kinds of stuff per column, before you add it at run time. So you could look into resorting the columns at runtime after binding the data to them.
Another possibility, is to change the select clause in your query, so that the order of the columns will already be correct in the dataset.
My advice is free, and you may get what you paid for.
|
|
|
|
|
ya we can reorder it using select query command,
Thanks!!
But i have another query is grid result show desigtime columns as well as runtime columns too!!
Than how to solve this problem?
|
|
|
|
|
If I understood you correctly, it sounds like something is going wrong with the data binding. In other words, you have the columns from design time, and then when the data is bound during runtime, a new set of columns is created instead of the existing ones being used.
My advice is free, and you may get what you paid for.
|
|
|
|
|
A couple of things to check...
First, in your binding code, make sure that you set the DataGridView's AutoGenerateColumns property to False.
Next, make sure your Columns that you created are setup properly to bind to the appropriate table/column names in the dataset/datatable.
|
|
|
|
|
Check to see if there is a GenerateColumns or an AutoGenerateColumns property and set it to false. You may need to write additional code to bind the design-time columns with the columns in the dataset.
|
|
|
|
|
That autogenerate property coes into asp.net application but not in windows,i checked that one also!!
Any other way?
|
|
|
|
|
KIDYA wrote: That autogenerate property coes into asp.net application but not in windows
You might want to check again. DataGridView doesn't work under ASP.NET. It's a WindowForms only control. You can find the documentation on AutoGenerateColumns here[^].
|
|
|
|
|
Hi.
Is there a way to use runningvalue expression using more than one field
I want to be able to perhaps use an IFF based on condition and once that condition is true then grab data from another field whilst keeping the running value count etc. is that even achievable.
e.g.
IIf fields!automotive = "CARS" then runningvalue(!fields!carsid)
IIf fields!automotive = "HOUSE" then runningvalue(!fields!housevalue)
***THIS WILL CODE WILL BE IN ONE TEXTBOX in REPORT VIEWER ****
etc etc
is there a way to use IFF and runningvalue and switch fields whilst running value keeps is count down all rows and again this is to be behind one textbox field producing output on report.
I'd appreciate any assistance on wether this can be done using IFF and runningvalue or perhaps if there is another command/function that will work
Many Thanks
Robbo
|
|
|
|
|
Dear All,
I have one query. Please help me.
Please send me the source code for Time and attendence system for fetching the data from Access Control database. The Database is MS-SQL. So i require the source code for fetching the data from database.
The all transactions will be stored in a single table. We have to fetech the first access and last access from the table including entry and exit time. How to solve the day over lapping ( The employee working in night shift and going next day morning) ?
Please help me.
With regards,
Ravisubrahmnaya
|
|
|
|
|
No.
My advice is free, and you may get what you paid for.
|
|
|
|
|
It is considered rude to ask for (or rather demand, in your case) source code. Try something on your own, and when you get struck somewhere, then come back and post specific questions about the problems you are facing.
|
|
|
|
|
Ravisubrahmanya wrote: Please send me the source code
...and this is where I stop reading you're post. NO, we will NOT just hand over source code so you can pass it off as your own work.
YOU have to write the code and if you have problems with something, then you can come here and ask specific questions about the problem.
Just showing up and asking for code, on any site, is very rude.
|
|
|
|
|
I'd be glad to stop doing what I am doing and write the code for you.
Better yet, send me the email address of your boss or teacher and I will save you any cut and paste time and trouble by sending the code directly to him. I will be sure and mention your name and send him a copy of your original post so you get everything that you deserve.
|
|
|
|
|
Hi,
I am writing this only after exhausting effort to search and find the solution was unsuccessful.
I am using Visual Studio 2005. The Test123 function written in C++ should be called from vb.net by using Interop Services.
The Testing.dll is a CLR dll.
Below is a simplified version of the C++ structure :
typedef struct TEST_STRUCT<br />
{<br />
long lTotal;<br />
int nRow;<br />
int nCol;<br />
CString sName;<br />
BOOL bFound;<br />
int item[100];<br />
} TEST;
Below is a simplified version of the structure declared in vb.net :
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Ansi)> _<br />
Public Structure TEST_STRUCT<br />
' ''<System.Runtime.InteropServices.FieldOffsetAttribute(0)> _<br />
Public lTotal As Integer<br />
Public nRow As Integer<br />
Public nCol As Integer<br />
<System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)> _<br />
Public sName As String<br />
<System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)> _<br />
Public bFound As Boolean<br />
<br />
'<System.Runtime.InteropServices.MarshalAsAttribute _<br />
'(System.Runtime.InteropServices.UnmanagedType.SafeArray, SafeArraySubType:=Runtime.InteropServices.VarEnum.VT_I4)> _<br />
<System.Runtime.InteropServices.MarshalAsAttribute _<br />
(System.Runtime.InteropServices.UnmanagedType.LPArray, SizeConst:=100)> _<br />
Public Item() As Integer<br />
End Structure<br />
<br />
Public Declare Auto Function Test123 Lib "Testing.dll" () As TEST_STRUCT<br />
What can work :
1) I can call the module Test123 from vb.net and it can run.
2) I can interop data for lTotal, nRow and nCol and receive at vb.net without any problem.
What my questions are :
1) How to interop data for sName, bFound and item[100]?
2) Which part I am wrong?
3) How should I declare the structure in vb.net to interop these data?
4) Can Interop support CString directly?
5) Is there any indirect way of marshaling which can work, such as doing the Interop in C# and then call from vb.net?
Your guidance on solving this problem is very much appreciated.
Thanks,
Goutam
|
|
|
|
|
Hi,
1.
AFAIK P/Invoke works equally well from VB.NET as from C#, so a C# detour does not make sense to me.
2.
To embed a fixed-size array inside a struct you need
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=100)>
3.
for the string, I'm not sure. You might define it as an IntPtr, and use one of the Marshal.PtrToStringXxx methods.
4.
as long as one struct member isn't marshaled correctly, everything that follows it may fail.
so start by putting the string last!
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hello Mr. Luc Pattyn,
Thank you for your prompt reply and interest in this topic.
When I do the testing, I comment out all and test one by one as below. When I can interop every value I need, only then I will put them together :
<br />
typedef struct TEST_STRUCT<br />
{<br />
int item[100];<br />
} TEST;<br />
<br />
<br />
extern "C" __declspec(dllexport) TEST_STRUCT Test123();<br />
<br />
extern "C" __declspec(dllexport) TEST_STRUCT Test123()<br />
{<br />
TEST_STRUCT TestStruct;<br />
<br />
TestStruct.item[0] = 11; <br />
<br />
return TestStruct;<br />
}<br />
1. I agree with you on this.
2. I tried the <MarshalAs(UnmanagedType.ByValArray, SizeConst:=100)>, and it didn't work.
If I declare the bFound as int16 at the vb.net side, then I can get 0 or 1. But that's not what we need.
3. Please enlighten me on the IntPtr and Marshal.PtrToStringXxx methods, as I am still not sure how to use it in this case.
>>4. as long as one struct member isn't marshaled correctly, everything that follows it may fail.
>>so start by putting the string last!
4. I appreciate this advice. I will strictly follow this.
I still could not interop sName, bFound and item[100]. I am getting error message "Method's type signature is not PInvoke compatible."
Any help will be amazing...
cheers,
Goutam
|
|
|
|