|
What you're doing wrong is that you're not really understanding concepts of OO. Form1 obviously doesn't contain a reference to the Form1 instance that is running in your program. You're also failing in two other areas:
1 - textBox1 is a dumb name for a variable
2 - it should never be a public variable
This is what delegates are for, set up a delegate that passes the text back to form1, and let form1 update the textbox with that text.
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 )
|
|
|
|
|
u need delegates and events
Public Delegate Sub OnSelect(ByVal val As String) 'Create a Delegate outside of the scope of class.
Public Shared Event TextBox2Date As OnSelect 'Code on the Form to create an event of your delegate type
on click event of the button on form2
fire this event
TextBox2Date(textbox2.text)
On form1 handle this event
AddHandler form2.TextBox2Date, AddressOf ShowDatainTextbox1
sub ShowDatainTextbox1 (val as string)
textbox1.text = val
end sub
hello
|
|
|
|
|
I have a DataGridView from which users can preview two different reports via a link column in the grid. Due to lack of space, and to make the grid look better, I'd like to give these two preview columns a single heading. For example, users can click on the Rpt1 column to preview Report 1, or Rpt2 to preview Report 2 but instead of this:
Preview | Preview
Rpt1 | Rpt2
I want it to look like this:
Preview
Rpt1 | Rpt2
Anyone have any ideas of how to accomplish this? I work with VS2005.
|
|
|
|
|
Set up one column to render the two data items as links with the | between them.
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 )
|
|
|
|
|
Okay, so how do I go about doing that?
What type of column to I make it? My only options appear to be:
DataGridViewButtonColumn
DataGridViewTextBoxColumn
DataGridViewCheckBoxColumn
DataGridViewComboBoxColumn
DataGridViewImageColumn
DataGridViewLinkColumn
And if I use a Link Column, I cannot figure out how to add another link to the Cell. I know I've done something like this in a web project before, but PC seems to be different. Do you have some specific code that can point me in the right direction?
I would appreciate any help.
|
|
|
|
|
Hmmm.... I have to admit I've not used a datagridview, and I assumed you were asking a web question.
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,
I am using VB6 with Crystal Report viewer.
I wrote a function that adds a picture to the report in runtime using OLEObject.
here is the code I'm using:
<br />
Set CrPic = CRXReport.Sections(NewPicture.Section).AddPictureObject(NewPicture.Path, NewPicture.XLoc, NewPicture.YLoc)<br />
<br />
CrPic.Width = NewPicture.Width<br />
CrPic.Height = NewPicture.Height<br />
the picture appears where I told it to be and in the requested size.
However, it seems that when I first load the picture into the OLE, it "takes" the size of the original picture, and doesn't change it after I change the size. So I have a lot of blank space.
I'm looking for a way to either make the OLE take less space from the beginning, or force some sort of refresh of the report.
Any suggestions?
Thanks.
|
|
|
|
|
For each row in my datagridview I would to like my dropdown to have its own items in its list. How can this be done?
|
|
|
|
|
Can you clarify your specification ? what you want exactly ?
/***********************/
Parwej Ahamad
g.parwez@gmail.com
/***********************/
|
|
|
|
|
One column in my datagridview is a combobox type. The items in the combobox need to be different for each row. For example if you click on the combobox on the first row in the datagridview you would see blue, red, and green. If you click on the combobox on the second row in the datagridview you would see orange, yellow, and brown. The combobox needs to have its own items for each row in the datagridview.
|
|
|
|
|
Hi Friends,
Help me how to call batch file from visual basic.
i created batch file like....
net use \\serverl\saal1 /user:admin 123456
The purpose of calling the batch file is, when i connect to the application (VB) before giving login details it should connect to the above server. So i m creating that as a batch file and have to call when my application starts.
Please help me.
Regards,
|
|
|
|
|
If you're using VB6 then you can use the Shell statement.
If you're using .NET you can something like this :
<br />
System.Diagnostics.Process pcBatch = new System.Diagnostics.Process();<br />
pcBatch.StartInfo.FileName = sFileName;<br />
pcBatch.Start();<br />
|
|
|
|
|
Hi,
I need help with Autosizing the form controls on the page when the form gets maximized or minimized.
can any one provide an idea how to acheive it.
Any links or postings please...
Jats
|
|
|
|
|
|
Hi ,
Now i found out the While adding the powerpacks shape at design time also , the panel is moving .
here is description .
At the design time of VS 2005 ,
Add a SplitContainer .
1) In that SplitContainer ,set
Panel1.AutoSize =true
Panel1.AutoScrollMargin=30, 30
Now add New Panel to Panel1 of SplitContainer which is having More Size than the panel1 of split Container then
We can see the scroll bars
2) Now add a powerpacks RectangleShape on the Bottom Right of the Panel Which is added to Panel1 of SplitContainer .
Check the thng
The Shape control added is moving up automatically to some location .
Here if we add normal controls like textbox,etc is not moving .OnlyFor Shapes like LineShape, RectangleShape ,OvalShape is moving for the first ShapeControl .
2) Same like this i am creating at runtime .Here the page is moving automatically ,
Now i want the panel to set at tht position only while drawing the things .????
How ????????
|
|
|
|
|
Hi,
I am creating a stream :
stream = file.create(filePAth) 'And it pops up a message here saying : "Illegal characters in path"
I have searched high and wide for illegal character, in normal view and hex, and there is none.
The only thing I can think of is the space character, I have searched google and found some things that can be done to prevent this usign @ in front of the string, but it doesn't work in VB.
Any ideas?
Thanks!
|
|
|
|
|
hi
first try it by using the static path like c:\
if it works fine then go for filePath variable and in that if want to remove only tralling and starting spaces then use
Trim(filePath)
else you could go for a loop like this
<br />
dim a as string <br />
<br />
for i=0 to len(filePath)-1<br />
if mid(filePath,i,1)<>" " then<br />
a=a+mid(filePath,i,1)<br />
endif<br />
next<br />
now a will the string without spaces
Yogesh Agarwal
|
|
|
|
|
Yes I know that, but I cannot change the string, this is an absolute path. The path cannot be changed...
I just need to tell the compiler, or that function or someone... that there is a space in the PATH string. So it can handle the space...
The path cannot be changed!
any other ideas.
Thanks
|
|
|
|
|
It's not about space characters. Your path has invalid characters. This code is a prove that space character is not the problem.
IO.File.Create("c:\ .txt")
Use this code to get where the invalid characters are.
filePAth.IndexOfAny(System.IO.Path.GetInvalidPathChars())
Eslam Afifi
|
|
|
|
|
I have created a mobile application and it is working fine, but I want to do one more task: I want to display a logo.
When the application is running - How can we display logo on the top of the screen with other icons such as time, network, roaming status, battery status etc.
Does anyone has a suggestion or answer....
Regards
|
|
|
|
|
Hello,
I am having the following problem when insetring in SQL 2005 from VB 2005
I have done a calculation wich result in a double variable with the name Total
In my SQL database the Total is defined as smallmoney
Need to Insert the Total into my SQL database so what i do :
SQL="Insert into Results (Total) Values ('"+ System.convert.tostring(Total)+"')"
The SQL insert is working but the Values are incorrect, something wrong with the Decimal point.
When i insert my double result that is the result of for ex. 3 * 2,5 --> 7,5 (Total) in the database there is 75,0000 in the SQL insert i insert 7,5
So i think that something is wrong with the decimal sign.
Maybe i need to insert 7.5 instead of 7,5 but how can i make that is will be correct converted so i can insert it right into SQL.
Any suggestions are very welcome.
I think that there is a simple solution but i dont see it anymore.
Thanks
DCAUB
|
|
|
|
|
Is your SQL Server set up to be localised to use a , as a decimal point ? Perhaps if you used a parameterised query, SQL Server and VB would work it out for you because instead of a string, you'd be passing a number with a specific value ? Or perhaps the smallmoney type has that many decimal places ? From MSDN: The money and smallmoney data types are accurate to a ten-thousandth of the monetary units that they represent.
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 want a code of Insurence Banking management system
|
|
|
|
|
It is depressing that I can't tell if you're joking or not.
If you're trolling, get a life. If you're not, hell, get a life. I can only assume that no-one would hire someone like you to write such a system, so I assume this is homework. Do your own homework.
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 )
|
|
|
|
|
...and people in Hell want ice water.
Did you have a specific question about writing this thing, or did you just want other people to do your work for you??
|
|
|
|