|
Again, without the code, posting the stack trace is just about useless. The top of the stack says there was a problem creating an instance of a COM server. When you code gets to InitializeComponent, hit F11 to step into it and keep going until you find the line that bombs.
|
|
|
|
|
I know 1.1 didnt but Im curious if 2.0 does. I want to list the currently opened windows in an application which could be unlimited technically and would like to be able to create a new MenuItem at runtime for each open window. I already have a plan for knowing the open windows.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
CleaKO wrote: I know 1.1 didnt but Im curious if 2.0 does.
What you have described is possible in .NET 1.1
A MenuItem is an object, just like any other. You create one and add it to the appropriate parent menu item.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Wow I had some bad wording on my question...
I meant to ask dynamically named and created controls where I dont have a set number of values which isnt what I really needed anyway, but thanks!
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
If i understand your question right, then yes you can. I needed to do something similar for a button bar for a project...I needed to be able to take a datatable and insert each row into a button bar as a button...There is alot more code then this for the entire process, but maybe this will give you an idea...
Imports DevExpress.XtraEditors<br />
Imports System.Drawing<br />
Imports ZipsUtils<br />
<br />
Public Class ButtonBarButton<br />
<br />
#Region " Const "<br />
Public Const kSpacing As Integer = 6<br />
<br />
Public Const kButtonTopH As Integer = 3<br />
Public Const kButtonLeftV As Integer = 6<br />
<br />
Public Const kLabelTopH As Integer = 102<br />
Public Const kLabelLeftV As Integer = 6<br />
Public Const kLabelHeight As Integer = 13<br />
#End Region<br />
<br />
#Region " Variables "<br />
Private mDevButton As SimpleButton<br />
Private mLabel As DevExpress.XtraEditors.LabelControl<br />
Private mButton As IZipsButtonBarButton<br />
Private mContainer As XtraScrollableControl<br />
Private mUseLabel As Boolean<br />
#End Region<br />
<br />
#Region " Propertys "<br />
Public ReadOnly Property DevButton() As SimpleButton<br />
Get<br />
Return mDevButton<br />
End Get<br />
End Property<br />
<br />
Public ReadOnly Property Label() As DevExpress.XtraEditors.LabelControl<br />
Get<br />
Return mLabel<br />
End Get<br />
End Property<br />
<br />
Public ReadOnly Property ButtonBarButton() As IZipsButtonBarButton<br />
Get<br />
Return mButton<br />
End Get<br />
End Property<br />
#End Region<br />
<br />
#Region " Constructor "<br />
Public Sub New(ByVal theButton As IZipsButtonBarButton, ByVal container As XtraScrollableControl, ByVal allignVerticaly As Boolean, ByVal theSize As Size, ByVal useLabels As Boolean)<br />
mButton = theButton<br />
mContainer = container<br />
mUseLabel = useLabels<br />
<br />
Dim numControls As Integer = mContainer.Controls.Count<br />
If Not allignVerticaly Then<br />
If mUseLabel Then<br />
Dim x As Integer = CInt(((numControls >> 1) * (theSize.Width + kSpacing)) + kSpacing)<br />
<br />
CreateButton(New Point(x, kButtonTopH), New Size(theSize.Width, theSize.Height), (numControls >> 1))<br />
CreateLabel(New Point(x, kLabelTopH), New Size(theSize.Width, kLabelHeight), (numControls >> 1))<br />
Else<br />
Dim x As Integer = CInt(numControls * (theSize.Width + kSpacing))<br />
<br />
CreateButton(New Point(x, kButtonTopH), New Size(theSize.Width, theSize.Height), numControls)<br />
End If<br />
Else<br />
If mUseLabel Then<br />
Dim y As Integer = ((kSpacing + ((numControls >> 1) * (theSize.Height + kSpacing))) + (kSpacing + ((numControls >> 1) * (kLabelHeight + kSpacing))))<br />
<br />
CreateButton(New Point(kButtonLeftV, y), New Size(theSize.Width, theSize.Height), (numControls >> 1))<br />
CreateLabel(New Point(kButtonLeftV, ((y + theSize.Height) + (kSpacing >> 1))), New Size(theSize.Width, kLabelHeight), (numControls >> 1))<br />
Else<br />
Dim y As Integer = (kSpacing + (numControls * (theSize.Height + kSpacing)))<br />
<br />
CreateButton(New Point(kButtonLeftV, y), New Size(theSize.Width, theSize.Height), numControls)<br />
End If<br />
End If<br />
End Sub<br />
#End Region<br />
<br />
#Region " Subs "<br />
Public Sub CreateButton(ByVal location As Point, ByVal size As Size, ByVal incrementSeed As Integer)<br />
Dim setImg As Image = Nothing<br />
If Not mButton.Image Is Nothing Then<br />
setImg = DBConLite.GetResizedImage(mButton.Image, New Size(size.Width, size.Height))<br />
End If<br />
<br />
mButton.Size = size<br />
<br />
mDevButton = New DevExpress.XtraEditors.SimpleButton<br />
With mDevButton<br />
.Location = location<br />
.Name = "SimpleButton" & incrementSeed<br />
.Size = size<br />
.TabIndex = 0<br />
<br />
If Not setImg Is Nothing Then<br />
.Image = setImg<br />
Else<br />
.Text = mButton.Name<br />
End If<br />
<br />
.Tag = Me<br />
End With<br />
<br />
mContainer.Controls.Add(mDevButton)<br />
End Sub<br />
<br />
Public Sub CreateLabel(ByVal location As Point, ByVal size As Size, ByVal incrementSeed As Integer)<br />
mLabel = New DevExpress.XtraEditors.LabelControl<br />
With mLabel<br />
.Appearance.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))<br />
.Appearance.Options.UseFont = True<br />
.Appearance.Options.UseTextOptions = True<br />
.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center<br />
.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.None<br />
.Location = location<br />
.Name = "LabelControl" & incrementSeed<br />
.Size = size<br />
.TabIndex = 0<br />
.Text = mButton.Name<br />
.Tag = Me<br />
End With<br />
<br />
mContainer.Controls.Add(mLabel)<br />
End Sub<br />
<br />
Public Sub Dispose()<br />
mDevButton.Dispose()<br />
<br />
If mUseLabel Then<br />
mLabel.Dispose()<br />
End If<br />
<br />
mDevButton = Nothing<br />
mLabel = Nothing<br />
mButton = Nothing<br />
End Sub<br />
#End Region<br />
<br />
End Class
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
How am I supposed to do this? Even with public Sub or Function definitions intellisence isn't displaying the methods when I type Me.SubFormName. while editing the code of the parent. I tried just typing the name of the method in manually to see if it was just an intellisence problem but that triggers a runtime error because "the method or data member not found".
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
i am using vb.net 2003.i am doing my project in vb.net windows application.
how do i remove selected row permanently from sql database through datagrid in vb.net windows form during runtime.
for example,
values are in datagrid like
name age rollno city
ramu 22 68 chennai
rajesh 23 70 cbe
kamal 21 52 salem
arun 25 04 trichy
here name,age,rollno,city are field name.now i want to remove selected row permanently from sql database through datagrid.In this datagrid,if i select "kamal" row(kamal,21,52,salem) means,that kamal row will remove permanently from sql database.how to do these.i want in vb.net windows application,not web application.plz help me.
|
|
|
|
|
If the datagrid is bound to the dataset, all you would have to do is select the row, hit the delete key to mark the row for deletion.
In your code, you would have to use an SqlDataAdpater[^] to update the database from the modified dataset. This code would typically be behind a "Save Changes" button on your form with the datagrid.
|
|
|
|
|
hi pls help me out in inserting text into a richtextbox.
the situation is like this::
i want to insert a string say "hello" at a particular location in the rich textbox.
The particular location is given in the form of X and Y coordinates.
eg:: PutString("hello",10,20)
i write a function that passes the string and x,y coordinates.
is that possible??
x,y coordinates will represent the location of the string in richtextbox.
any ideas.. pls help!!
thnx....
ajith
|
|
|
|
|
Sure. In your "PutString" method, you'd have to call the RTB's GetCharIndexFromPosition method to get the character index of the point in question. Then it's just simple string manipulation, using the Insert method on the string returned by the RTB's Text property.
Dim charIndex As Integer = RTB.GetCharIndexFromPosition(point)
RTB.Text = RTB.Text.Insert(characterIndex, newText)
|
|
|
|
|
how to send screen resolution on serial port in VB
|
|
|
|
|
The screen solution would just be a couple of numbers. You send that as a string out the serial port just like any other string of text.
First, what does the device that your sending this information to expect? In what format does it expect this information?
Second, which version of VB?? VB6, VB.NET 2002, 2003, or 2005?
|
|
|
|
|
Hello All,
I am creating a class library which will start external application. i have added a button in the external application, on click of that button that has to run a function which i have included in the class function. it is terminating the program . Does anyone has any idea regarding this?
Help is required.
Thanks in advance
Bharath.S Ron
|
|
|
|
|
You can step into the dll from your app in the debugger, to see what the issue is
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You're going to have to step into the code for the .DLL (provided you have the source code for it!) and find out what's going on in there.
With the description of the problem you gave, that's about the only thing anyone can tell you to do. You haven't said anything about the code, any exceptions you're getting, what the thing is supposed to do, ... nothing. Because of this, it's really hard to give any advice that would mean anything.
|
|
|
|
|
What method do you think is better when there are many threads?
Regards,
Analizzatore Cloro
|
|
|
|
|
|
hi. did you have a question ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Solution 1: buy a magic lamp and carefully consider how you are going to formulate each of three wishes, and polish the lamp.
Solution 2: If you have more than three wishes, be very nice all year, send a list with your wishes to Santa Claus, The North Pole, and keep you fingers crossed.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi All.
My program need to kill a process, and it works well .. BUT:
When the process die, leave a taskbar dead icon that goes away by passing with mouse on it.
So my question is:
There's something like a Taskbar.resfresh() method that could make that work for me??
any other idea??
Thanks!
G.
|
|
|
|
|
No, there isn't. You've foudn the only way to make that icon disappear.
|
|
|
|
|
Hi all,
I currently using VB.NET, i want to assign icon to the form, but i don't know how to do becuase.
Me.Icon = Icon
but i want to change to another icon that store on website
Me.Icon = "http://www.khmerfriend.com/ks.ico"
it not work, please help me.
Socheat
................
|
|
|
|
|
You can't do that. You will have to pull the icon down from the website first and store it in memory then assign it to the Form's icon property.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Can you give me example of code?
Socheat
................
|
|
|
|
|
Not off the top of my head. Look for classes in the System.Net namespace WebRequest and WebResponse come to mind.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|