|
I hope that i had undestund what you want. See this example ,
the idea is that the user selects from the droplist ( here a set the autopostbask to true ) and i pass the selected item text to the label.
When the user press the button "go" te program checks the drop down selected item index and redirects the user to the coresponding page.
Hope i helped you
Ramaseb
---------------------------------------
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents Drop1 As System.Web.UI.WebControls.DropDownList
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
Drop1.Items.Clear()
Drop1.Items.Add("page 1")
Drop1.Items.Add("page 2")
Drop1.Items.Add("page 3")
End If
End Sub
Private Sub Drop1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Drop1.SelectedIndexChanged
Label1.Text = Drop1.SelectedItem.Text
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Select Case Drop1.SelectedIndex
Case 0
Response.Redirect("mypage1.aspx")
Case 1
Response.Redirect("mypage2.aspx")
Case 2
Response.Redirect("mypage3.aspx")
End Select
End Sub
End Class
Ramaseb.
|
|
|
|
|
Actually, I was looking to select the value Page1 from Drop1 on the main page. When you select Page1 it then redirects you to Page1, accepts the value, and displays it in Label1 on Page1 without a submit button.
Thanks much!
|
|
|
|
|
Hi,
Can anyone help me with importing a fortran 8.0 dll to vb.net.I have tried several times with the following code but get an error saying that the entry point in the dll was not found.
I have a module in vb.net that contains the following code.
Declare Sub runit Lib "C:\Documents and Settings\User\My Documents\Visual Studio Projects\Dll1\Debug\Dll1.dll" _
(list of arguements) where Dll1 is the name of the fortran project.and runit is the subroutine i am trying to call from .net. I dont know what to do.Is there any configurations that i must set before trying to run the program.
|
|
|
|
|
try adding an "alias" to your declaration, this alias should have the same name as the main subroutine in your app (you may follow this with A [for ANSI] or W [for ASCII]). you then invoke the routine thru this alias. another workaround is using the DLLImportAttribute becoz with this you can specify the entry point during declaration.
|
|
|
|
|
you would call it this way:
Private Declare Sub RunItFtrn Lib "DLL1.dll" Alias "runit" (ByRef ..., ByRef ..., ect...)
but I would suggest reading this:
http://www.codeproject.com/dotnet/intro_fortran.asp
|
|
|
|
|
Hi..
are tou sure that the dll "exports" the function??
Ramaseb.
|
|
|
|
|
I am sorry to bother everyone again, though I had another quick question. What determines what form will show first within your project? Let us say we had three forms, what value, code or settings states that Form1 shows first?
I want to add a form before my main form - such as a flash screen - or just another form for anything - though do not know how to make it and then have it load first rather than when it is called by form1. Any help would be greatly appreciated.
Links, Articles, Books, anything would help. Thanks!
~Achithyn
|
|
|
|
|
you set the statup object in the project properties. assuming you are using vs.net right click your project in the solution explorer and click properties.
the properties dialog will come up and should default to the "Common Properties - General" page. In here you'll see a combobox titled "Startup Object" listing your options for the main form/object.
when you expand this combobox you should basically have any forms you have created in your project, select whichever one you wish to be the main form.
hope this helps.
-jim
|
|
|
|
|
In addition to what jmatthew said, splash screens should not be the Startup Form. The first form that is executed can not be unloaded unless you want your app to quit. The first, or main, form should be your startup form, then this form can load and show the splash form while the main form is doing it's initialization. When that's complete, the main form can hide and the dispose the splash form, then show itself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That is truly awesome. I found the properties section of everything else 'other' than the projects properties - now I have that as well. This opens up a lot more for me to explore and answers several questions that I would have eventually asked if I had not discovered this (learned of it from both of you).
As for Hiding and Closing the main form - I understand now how that works and will work with it to make my program better. Thanks for the help both of you - it is mightily helpful.
~Achithyn
|
|
|
|
|
Hi..
some more info.
When you set in project properties the "start-up object”, setting so the first form as a start-up form, behind the scenes the Visual Studio adds a sub Main to your form. The sub Main is the entry point for your application. If you declare this sub Main in the startup form , you can put any code in this sub and control the start up behaviour of your application. Try to search the help for the sub main, and see what you can do there.
Hope i helped you.
Ramaseb.
|
|
|
|
|
Awesome, I will do just that. Thank you for letting me know about the sub Main - I will see how I can use it to help my applications.
Thanks!
~Achithyn
|
|
|
|
|
I created set of radio buttons which depending on what is selected will make a DIV tag visible or hidden, but since this is only client side code every time I do a submit on my form the div tag will appear. And this is whether on not the radio button which hides my div tag is selected.
So to solve this I created a JavaScript function which will check to see which radio button is selected and either hide the div tag or make it visible, but I have not found a way to call the function. I went into the HTML CODE on my VB page and added a onload call to my function from the body tag but this also didn’t work. I do understand that attributes can be added to a button but only events. My question is, "Does anyone know how to call a JavaScript function every time the page is loaded"?
Thanks
|
|
|
|
|
Hi ...
in the code below this javascript must be runing every time the page is loaded ( i think ..)
<HTML>
<body>
/* other page stuff here
*/
<script>
/*Current date script credit:
JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","Mai","June","July","August","September","October","November","December")
document.write("<div style ='position: absolute; left:8; bottom:10' ><small><font face='Times New Roman'>"+dayarray[day]+" "+daym+" "+montharray[month]+" "+year+"</font></small></div>")
</script>
</body>
</HTML>
as you understand the script runs and writes something in the page ( i thing the date info )
Maybe if you use the same aproach as the example you can do that you want.
Hope i helped you
Ramaseb.
Ramaseb.
|
|
|
|
|
Thanks that is a good idea let me try it.
|
|
|
|
|
You fashion your javascript so that it can be placed in the <head></head> section of your HTML. This gets processed EVEN BEFORE the body loads.
|
|
|
|
|
Thanks, this worked.
|
|
|
|
|
I have a MS Word document and I'm iterating through every Shape/Inline shape in it (I'm using VB .NET). And I want to save each of these shapes into a separate file. If its an image/drawing/diagram then in a GIF file, if its an audio then MP3/WAV/MIDI file and so on.
However I'm having problems with embedded OLE objects. I have a MP3 and a RAM file embedded in the document. But I can't seem to find any way to get a handle to these objects or the link to these files.
I tried OLEFormat.object but I get an "No such interface supported" error.
Smriti
|
|
|
|
|
Hi..
have you used the new stuff from OFFICE 2003 , ( the new object model and
the native .net support ) !! you can find some info at msdn.microsoft.com
or
http://msdn.microsoft.com/office/understanding/officesystem/codesamples/default.aspx?pull=/msdnmag/issues/03/09/microsoftoffice2003/toc.asp
Hope I helped you..
Ramaseb
Ramaseb.
|
|
|
|
|
Yup, I'm using the new model only. I don't know about the old model but the new document is like this:
Shape/InlineShape -> OleFormat property -> Object property
The OLEFormat property is supposed to be used when the shape is an OLE object. So in case of images I access the image through Shape.OLEFormat.object. But it doesn't seem to work when the object is an audio/video file.
Thanks anyway,
Smriti
|
|
|
|
|
Hello ..
Please can anyboddy help me to this problems??
I'm trying to use foxpro tables ( !! ) with foxpro oledb provider.
My first problem is that Visual Studio cannot understand key columns so , no update and delete statements are produced for data adapters.
I bypass this problem by "copying" the table to a sql database , set the key collumns , create an oledb data adapter to sql database/table ( everything created ok !!) and then change the connection string to foxpro ole db provider !!
My second problem is that when i try to issue a foxpro command like "append from file delimited" i get a message for "errors during processing command" and nothing is loaded to the table !! Other commands like PACK table , or DELETE ALL FROM TABLE , are working fine !! The same delimited file is processed with out errors inside the foxpro 9 ( beta ) environment.
Any suggestions...??
Thank's , and i'am sorry for my terrible english.
Ramaseb.
|
|
|
|
|
Q1. RDO is supported only on___BIT Operating System
Choices are:
a)8
b)16
c)32
d)64
Q2. If the variable is created by Visual Baisc it is called
Choices are:
a)Local
b)Implicit
c)Explicit
d)Private
Mohan Balal
|
|
|
|
|
We're not doing your homework for you...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
... too late, someone already did.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
|
|
|
|
|
Hi mohan_balal
For Q1. if you mean the RDO for data access , that visual basic 6 and prior uses , i think that is for 32 bit systems ( WINDOWS 95 , 98 , NT , 2000 , XP ) , but im not sure that RDO plays with 64bit windows.
For Q2. the answers are related with "variables" but for different reasons.
a) you can declare a variable in a procedure or function or inside a code block in a procedure or a function and this variable called "local"
b-c) Impicit , Explicit , hmmmm... this is "instructions" to the compiler ( and /or refers to conversion from one type to other ) tell the behaviour about when you try to give a value from a variable to another variable that isnt excacty the same type, or use a variable in a procedure,function or method or property call that isnt actual the same type as in the definitions of all those ( general speaking ).
d) Private. In a class definition you can give a "visibility" to members functions or variables . an examble
.....
class aaaa
private var1 as string
public var2 as string
private sub sub1
end sub
public sub sub2
end sub
end class
.....
when you later in your rest code you use an object of type aaaa you can refer only to var2 and sub2 because are the only visible outside of the class !! the "word" private "hides" the var1 and var2 from outside the class/object
I Hope I helped you ....
Ramaseb
Ramaseb.
|
|
|
|